Skip to content

Commit

Permalink
bugfix: compile
Browse files Browse the repository at this point in the history
  • Loading branch information
xjdrew committed Sep 20, 2018
1 parent 1a7509a commit ffebe34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 24 deletions.
17 changes: 3 additions & 14 deletions src/lcrypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
#include "lcrypto.h"
#include "lcrypto_compat_110.h"

LUACRYPTO_API int luaopen_crypto(lua_State* L);

static int crypto_error(lua_State* L)
{
char buf[120];
Expand Down Expand Up @@ -1779,7 +1777,7 @@ static int x509_ca_add_pem(lua_State* L)
/*
** Create a metatable and keep stack balance when leave
*/
LUACRYPTO_API void luacrypto_createmeta(lua_State* L, const char* name, const luaL_Reg* methods)
static void luacrypto_createmeta(lua_State* L, const char* name, const luaL_Reg* methods)
{
if (!luaL_newmetatable(L, name))
return;
Expand Down Expand Up @@ -1919,19 +1917,10 @@ static void create_metatables(lua_State* L)
NONCALLTABLE(pkey);
}

/*
** Define the metatable for the object on top of the stack
*/
LUACRYPTO_API void luacrypto_setmeta(lua_State* L, const char* name)
{
luaL_getmetatable(L, name);
lua_setmetatable(L, -2);
}

/*
** Assumes the table is on top of the stack.
*/
LUACRYPTO_API void luacrypto_set_info(lua_State* L)
static void luacrypto_set_info(lua_State* L)
{
lua_pushliteral(L, "_COPYRIGHT");
lua_pushliteral(L, "Copyright (C) 2005-2006 Keith Howe");
Expand All @@ -1948,7 +1937,7 @@ LUACRYPTO_API void luacrypto_set_info(lua_State* L)
** Creates the metatables for the objects and registers the
** driver open method.
*/
LUACRYPTO_API int luaopen_crypto(lua_State* L)
int luaopen_crypto(lua_State* L)
{
struct luaL_Reg core_functions[] = {
{ "list", luacrypto_list },
Expand Down
10 changes: 0 additions & 10 deletions src/lcrypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
#ifndef _LUACRYPTO_
#define _LUACRYPTO_

#ifndef LUACRYPTO_API
#define LUACRYPTO_API LUA_API
#endif

#define LUACRYPTO_PREFIX "LuaCrypto: "
#define LUACRYPTO_CORENAME "crypto"
#define LUACRYPTO_DIGESTNAME "crypto.digest"
Expand All @@ -27,10 +23,4 @@
#define LUACRYPTO_X509_CERT_NAME "crypto.x509"
#define LUACRYPTO_X509_CA_NAME "crypto.x509_ca"

LUACRYPTO_API void luacrypto_createmeta (lua_State *L, const char *name, const luaL_Reg *methods);
LUACRYPTO_API void luacrypto_setmeta (lua_State *L, const char *name);
LUACRYPTO_API void luacrypto_set_info (lua_State *L);
LUACRYPTO_API int luaopen_crypto(lua_State *L);
void __attribute__ ((constructor)) luacrypto_init(void);

#endif

0 comments on commit ffebe34

Please sign in to comment.