1 /* This is a C++ wrapper to compile the lua C code 2 * with settings appropriate for including it with 3 * Ardour. 4 */ 5 6 #include "lua/liblua_visibility.h" 7 8 #if _MSC_VER 9 # pragma push_macro("_CRT_SECURE_NO_WARNINGS") 10 # ifndef _CRT_SECURE_NO_WARNINGS 11 # define _CRT_SECURE_NO_WARNINGS 12 # endif 13 #elif defined(__clang__) 14 # pragma clang diagnostic push 15 # pragma clang diagnostic ignored "-Wcast-qual" 16 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 17 # pragma GCC diagnostic push 18 # pragma GCC diagnostic ignored "-Wcast-qual" 19 #endif 20 21 // forward ardour's defines to luaconf.h 22 #ifdef PLATFORM_WINDOWS 23 # define LUA_USE_WINDOWS 24 #elif defined __APPLE__ 25 # define LUA_USE_MACOSX 26 #else 27 # define LUA_USE_LINUX 28 #endif 29 30 // forward liblua visibility to luaconf.h 31 #ifdef LIBLUA_BUILD_AS_DLL 32 #define LUA_BUILD_AS_DLL 33 #endif 34 35 extern "C" 36 { 37 38 #define lobject_c 39 #define lvm_c 40 #define LUA_CORE 41 #define LUA_LIB 42 #include "lua-5.3.5/luaconf.h" 43 #undef lobject_c 44 #undef lvm_c 45 #undef LUA_CORE 46 #undef LUA_LIB 47 48 // override luaconf.h symbol export 49 #ifdef LIBLUA_STATIC // static lib (no DLL) 50 # undef LUA_API 51 # undef LUALIB_API 52 # undef LUAMOD_API 53 # define LUA_API extern "C" 54 # define LUALIB_API LUA_API 55 # define LUAMOD_API LUALIB_API 56 #endif 57 58 // disable support for extenal libs 59 #undef LUA_DL_DLL 60 #undef LUA_USE_DLOPEN 61 62 // enable bit lib 63 #define LUA_COMPAT_BITLIB 64 65 #if _MSC_VER 66 #pragma warning (push) 67 #pragma warning (disable: 4244) /* Possible loss of data */ 68 #pragma warning (disable: 4702) /* Unreachable code */ 69 #endif 70 71 #include "lua-5.3.5/ltable.c" 72 73 #include "lua-5.3.5/lauxlib.c" 74 #include "lua-5.3.5/lbaselib.c" 75 76 #include "lua-5.3.5/lbitlib.c" 77 #include "lua-5.3.5/lcorolib.c" 78 #include "lua-5.3.5/ldblib.c" 79 #include "lua-5.3.5/linit.c" 80 #include "lua-5.3.5/liolib.c" 81 #include "lua-5.3.5/lmathlib.c" 82 #include "lua-5.3.5/loslib.c" 83 #include "lua-5.3.5/lstrlib.c" 84 #include "lua-5.3.5/ltablib.c" 85 86 #include "lua-5.3.5/lapi.c" 87 #include "lua-5.3.5/lcode.c" 88 #include "lua-5.3.5/lctype.c" 89 #include "lua-5.3.5/ldebug.c" 90 #include "lua-5.3.5/ldo.c" 91 #include "lua-5.3.5/ldump.c" 92 #include "lua-5.3.5/lfunc.c" 93 #include "lua-5.3.5/lgc.c" 94 #include "lua-5.3.5/llex.c" 95 #include "lua-5.3.5/lmem.c" 96 #include "lua-5.3.5/lobject.c" 97 #include "lua-5.3.5/lopcodes.c" 98 #include "lua-5.3.5/lparser.c" 99 #include "lua-5.3.5/lstate.c" 100 #include "lua-5.3.5/lstring.c" 101 #include "lua-5.3.5/ltm.c" 102 #include "lua-5.3.5/lundump.c" 103 #include "lua-5.3.5/lutf8lib.c" 104 #include "lua-5.3.5/lvm.c" 105 #include "lua-5.3.5/lzio.c" 106 107 #include "lua-5.3.5/loadlib.c" 108 109 #if _MSC_VER 110 #pragma warning (pop) 111 #endif 112 113 } // end extern "C" 114 115 #if _MSC_VER 116 # pragma pop_macro("_CRT_SECURE_NO_WARNINGS") 117 #elif defined(__clang__) 118 # pragma clang diagnostic pop 119 #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) 120 # pragma GCC diagnostic pop 121 #endif 122