about summary refs log tree commit diff stats
path: root/src/luasec/compat.h
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-21 15:55:52 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-21 15:55:52 -0800
commit5a484efe8c72a929382c96555a31129f8d2a55c8 (patch)
tree60f6b76e3c06dbc1bfb9fe9e978475256e8a8f6d /src/luasec/compat.h
parent3b44b9827d5e9c6554c5600c45d832d4e6eb50f8 (diff)
downloadteliva-5a484efe8c72a929382c96555a31129f8d2a55c8.tar.gz
https now working!
Still extremely ugly:
- I've inlined all the namespaces under ssl, so you need to know that
  context and config are related to ssl.
- luasec comes with its own copy of luasocket. I haven't deduped that
  yet.
Diffstat (limited to 'src/luasec/compat.h')
-rw-r--r--src/luasec/compat.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/luasec/compat.h b/src/luasec/compat.h
new file mode 100644
index 0000000..1c88de9
--- /dev/null
+++ b/src/luasec/compat.h
@@ -0,0 +1,57 @@
+/*--------------------------------------------------------------------------
+ * LuaSec 1.0.2
+ *
+ * Copyright (C) 2006-2021 Bruno Silvestre
+ *
+ *--------------------------------------------------------------------------*/
+
+#ifndef LSEC_COMPAT_H
+#define LSEC_COMPAT_H
+
+#include <openssl/ssl.h>
+
+//------------------------------------------------------------------------------
+
+#if defined(_WIN32)
+#define LSEC_API __declspec(dllexport) 
+#else
+#define LSEC_API extern
+#endif
+
+//------------------------------------------------------------------------------
+
+#if (LUA_VERSION_NUM == 501)
+
+#define luaL_testudata(L, ud, tname)  lsec_testudata(L, ud, tname)
+#define setfuncs(L, R)    luaL_register(L, NULL, R)
+#define lua_rawlen(L, i)  lua_objlen(L, i)
+
+#ifndef luaL_newlib
+#define luaL_newlib(L, R) do { lua_newtable(L); luaL_register(L, NULL, R); } while(0)
+#endif
+
+#else
+#define setfuncs(L, R) luaL_setfuncs(L, R, 0)
+#endif
+
+//------------------------------------------------------------------------------
+
+#if (!defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x1010000fL))
+#define LSEC_ENABLE_DANE
+#endif
+
+//------------------------------------------------------------------------------
+
+#if !((defined(LIBRESSL_VERSION_NUMBER) && (LIBRESSL_VERSION_NUMBER < 0x2070000fL)) || (OPENSSL_VERSION_NUMBER < 0x1010000fL))
+#define LSEC_API_OPENSSL_1_1_0
+#endif
+
+//------------------------------------------------------------------------------
+
+#if !defined(LIBRESSL_VERSION_NUMBER) && ((OPENSSL_VERSION_NUMBER & 0xFFFFF000L) == 0x10101000L)
+#define LSEC_OPENSSL_1_1_1
+#endif
+
+//------------------------------------------------------------------------------
+
+#endif