Skip to content

Commit ffebe34

Browse files
author
xjdrew
committed
bugfix: compile
1 parent 1a7509a commit ffebe34

File tree

2 files changed

+3
-24
lines changed

2 files changed

+3
-24
lines changed

src/lcrypto.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include "lcrypto.h"
3232
#include "lcrypto_compat_110.h"
3333

34-
LUACRYPTO_API int luaopen_crypto(lua_State* L);
35-
3634
static int crypto_error(lua_State* L)
3735
{
3836
char buf[120];
@@ -1779,7 +1777,7 @@ static int x509_ca_add_pem(lua_State* L)
17791777
/*
17801778
** Create a metatable and keep stack balance when leave
17811779
*/
1782-
LUACRYPTO_API void luacrypto_createmeta(lua_State* L, const char* name, const luaL_Reg* methods)
1780+
static void luacrypto_createmeta(lua_State* L, const char* name, const luaL_Reg* methods)
17831781
{
17841782
if (!luaL_newmetatable(L, name))
17851783
return;
@@ -1919,19 +1917,10 @@ static void create_metatables(lua_State* L)
19191917
NONCALLTABLE(pkey);
19201918
}
19211919

1922-
/*
1923-
** Define the metatable for the object on top of the stack
1924-
*/
1925-
LUACRYPTO_API void luacrypto_setmeta(lua_State* L, const char* name)
1926-
{
1927-
luaL_getmetatable(L, name);
1928-
lua_setmetatable(L, -2);
1929-
}
1930-
19311920
/*
19321921
** Assumes the table is on top of the stack.
19331922
*/
1934-
LUACRYPTO_API void luacrypto_set_info(lua_State* L)
1923+
static void luacrypto_set_info(lua_State* L)
19351924
{
19361925
lua_pushliteral(L, "_COPYRIGHT");
19371926
lua_pushliteral(L, "Copyright (C) 2005-2006 Keith Howe");
@@ -1948,7 +1937,7 @@ LUACRYPTO_API void luacrypto_set_info(lua_State* L)
19481937
** Creates the metatables for the objects and registers the
19491938
** driver open method.
19501939
*/
1951-
LUACRYPTO_API int luaopen_crypto(lua_State* L)
1940+
int luaopen_crypto(lua_State* L)
19521941
{
19531942
struct luaL_Reg core_functions[] = {
19541943
{ "list", luacrypto_list },

src/lcrypto.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#ifndef _LUACRYPTO_
77
#define _LUACRYPTO_
88

9-
#ifndef LUACRYPTO_API
10-
#define LUACRYPTO_API LUA_API
11-
#endif
12-
139
#define LUACRYPTO_PREFIX "LuaCrypto: "
1410
#define LUACRYPTO_CORENAME "crypto"
1511
#define LUACRYPTO_DIGESTNAME "crypto.digest"
@@ -27,10 +23,4 @@
2723
#define LUACRYPTO_X509_CERT_NAME "crypto.x509"
2824
#define LUACRYPTO_X509_CA_NAME "crypto.x509_ca"
2925

30-
LUACRYPTO_API void luacrypto_createmeta (lua_State *L, const char *name, const luaL_Reg *methods);
31-
LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char *name);
32-
LUACRYPTO_API void luacrypto_set_info (lua_State *L);
33-
LUACRYPTO_API int luaopen_crypto(lua_State *L);
34-
void __attribute__ ((constructor)) luacrypto_init(void);
35-
3626
#endif

0 commit comments

Comments
 (0)