diff options
author | William Ahern <william@Williams-MacBook-Air.local> | 2012-10-10 16:46:28 -0700 |
---|---|---|
committer | William Ahern <william@Williams-MacBook-Air.local> | 2012-10-10 16:46:28 -0700 |
commit | 7bdf2557bbf7267542604567a0db809657b54d97 (patch) | |
tree | 13ba523c6f40b70536bc4ca8c4cc661948f831a8 /openssl.c | |
parent | ac93581c90d8a1612ce01e3a308d572f98002924 (diff) | |
download | luaossl-7bdf2557bbf7267542604567a0db809657b54d97.tar.gz luaossl-7bdf2557bbf7267542604567a0db809657b54d97.tar.bz2 luaossl-7bdf2557bbf7267542604567a0db809657b54d97.zip |
-n
fix compile for LuaJIT
Diffstat (limited to 'openssl.c')
-rw-r--r-- | openssl.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -52,6 +52,9 @@ | |||
52 | #include <lualib.h> | 52 | #include <lualib.h> |
53 | #include <lauxlib.h> | 53 | #include <lauxlib.h> |
54 | 54 | ||
55 | #if LUA_VERSION_NUM < 502 | ||
56 | #include "compat52.h" | ||
57 | #endif | ||
55 | 58 | ||
56 | #define BIGNUM_CLASS "OpenSSL Bignum" | 59 | #define BIGNUM_CLASS "OpenSSL Bignum" |
57 | #define PUBKEY_CLASS "OpenSSL Pubkey" | 60 | #define PUBKEY_CLASS "OpenSSL Pubkey" |
@@ -1665,7 +1668,11 @@ static int xc_digest(lua_State *L) { | |||
1665 | luaL_Buffer B; | 1668 | luaL_Buffer B; |
1666 | unsigned i; | 1669 | unsigned i; |
1667 | 1670 | ||
1671 | #if LUA_VERSION_NUM < 502 | ||
1672 | luaL_buffinit(L, &B); | ||
1673 | #else | ||
1668 | luaL_buffinitsize(L, &B, 2 * len); | 1674 | luaL_buffinitsize(L, &B, 2 * len); |
1675 | #endif | ||
1669 | 1676 | ||
1670 | for (i = 0; i < len; i++) { | 1677 | for (i = 0; i < len; i++) { |
1671 | luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); | 1678 | luaL_addchar(&B, x[0x0f & (md[i] >> 4)]); |