2016-04-04 07:42:50 -04:00
|
|
|
/* This is a C++ wrapper to compile the lua C code
|
|
|
|
* with settings appropriate for including it with
|
|
|
|
* Ardour.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "lua/liblua_visibility.h"
|
|
|
|
|
2016-02-13 16:31:17 -05:00
|
|
|
#if _MSC_VER
|
2016-04-04 07:42:50 -04:00
|
|
|
# pragma push_macro("_CRT_SECURE_NO_WARNINGS")
|
|
|
|
# ifndef _CRT_SECURE_NO_WARNINGS
|
|
|
|
# define _CRT_SECURE_NO_WARNINGS
|
|
|
|
# endif
|
|
|
|
#elif defined(__clang__)
|
|
|
|
# pragma clang diagnostic push
|
|
|
|
# pragma clang diagnostic ignored "-Wcast-qual"
|
|
|
|
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
|
|
|
# pragma GCC diagnostic push
|
|
|
|
# pragma GCC diagnostic ignored "-Wcast-qual"
|
2016-02-13 16:31:17 -05:00
|
|
|
#endif
|
|
|
|
|
2016-04-04 07:42:50 -04:00
|
|
|
// forward ardour's defines to luaconf.h
|
2016-02-13 16:31:17 -05:00
|
|
|
#ifdef PLATFORM_WINDOWS
|
2016-04-04 07:42:50 -04:00
|
|
|
# define LUA_USE_WINDOWS
|
2016-02-13 16:31:17 -05:00
|
|
|
#elif defined __APPLE__
|
2016-04-04 07:42:50 -04:00
|
|
|
# define LUA_USE_MACOSX
|
2016-02-13 16:31:17 -05:00
|
|
|
#else
|
2016-04-04 07:42:50 -04:00
|
|
|
# define LUA_USE_LINUX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// forward liblua visibility to luaconf.h
|
|
|
|
#ifdef LIBLUA_BUILD_AS_DLL
|
|
|
|
#define LUA_BUILD_AS_DLL
|
2016-02-13 16:31:17 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
|
|
|
|
#define lobject_c
|
|
|
|
#define lvm_c
|
|
|
|
#define LUA_CORE
|
|
|
|
#define LUA_LIB
|
2017-11-28 22:22:26 -05:00
|
|
|
#include "lua-5.3.4/luaconf.h"
|
2016-02-13 16:31:17 -05:00
|
|
|
#undef lobject_c
|
|
|
|
#undef lvm_c
|
|
|
|
#undef LUA_CORE
|
|
|
|
#undef LUA_LIB
|
|
|
|
|
|
|
|
// override luaconf.h symbol export
|
2016-04-04 07:42:50 -04:00
|
|
|
#ifdef LIBLUA_STATIC // static lib (no DLL)
|
|
|
|
# undef LUA_API
|
|
|
|
# undef LUALIB_API
|
|
|
|
# undef LUAMOD_API
|
|
|
|
# define LUA_API extern "C"
|
|
|
|
# define LUALIB_API LUA_API
|
|
|
|
# define LUAMOD_API LUALIB_API
|
|
|
|
#endif
|
2016-02-13 16:31:17 -05:00
|
|
|
|
|
|
|
// disable support for extenal libs
|
|
|
|
#undef LUA_DL_DLL
|
|
|
|
#undef LUA_USE_DLOPEN
|
|
|
|
|
|
|
|
// enable bit lib
|
|
|
|
#define LUA_COMPAT_BITLIB
|
|
|
|
|
|
|
|
#if _MSC_VER
|
|
|
|
#pragma warning (push)
|
|
|
|
#pragma warning (disable: 4244) /* Possible loss of data */
|
|
|
|
#pragma warning (disable: 4702) /* Unreachable code */
|
|
|
|
#endif
|
|
|
|
|
2017-11-28 22:22:26 -05:00
|
|
|
#include "lua-5.3.4/ltable.c"
|
|
|
|
|
|
|
|
#include "lua-5.3.4/lauxlib.c"
|
|
|
|
#include "lua-5.3.4/lbaselib.c"
|
|
|
|
|
|
|
|
#include "lua-5.3.4/lbitlib.c"
|
|
|
|
#include "lua-5.3.4/lcorolib.c"
|
|
|
|
#include "lua-5.3.4/ldblib.c"
|
|
|
|
#include "lua-5.3.4/linit.c"
|
|
|
|
#include "lua-5.3.4/liolib.c"
|
|
|
|
#include "lua-5.3.4/lmathlib.c"
|
|
|
|
#include "lua-5.3.4/loslib.c"
|
|
|
|
#include "lua-5.3.4/lstrlib.c"
|
|
|
|
#include "lua-5.3.4/ltablib.c"
|
|
|
|
|
|
|
|
#include "lua-5.3.4/lapi.c"
|
|
|
|
#include "lua-5.3.4/lcode.c"
|
|
|
|
#include "lua-5.3.4/lctype.c"
|
|
|
|
#include "lua-5.3.4/ldebug.c"
|
|
|
|
#include "lua-5.3.4/ldo.c"
|
|
|
|
#include "lua-5.3.4/ldump.c"
|
|
|
|
#include "lua-5.3.4/lfunc.c"
|
|
|
|
#include "lua-5.3.4/lgc.c"
|
|
|
|
#include "lua-5.3.4/llex.c"
|
|
|
|
#include "lua-5.3.4/lmem.c"
|
|
|
|
#include "lua-5.3.4/lobject.c"
|
|
|
|
#include "lua-5.3.4/lopcodes.c"
|
|
|
|
#include "lua-5.3.4/lparser.c"
|
|
|
|
#include "lua-5.3.4/lstate.c"
|
|
|
|
#include "lua-5.3.4/lstring.c"
|
|
|
|
#include "lua-5.3.4/ltm.c"
|
|
|
|
#include "lua-5.3.4/lundump.c"
|
|
|
|
#include "lua-5.3.4/lutf8lib.c"
|
|
|
|
#include "lua-5.3.4/lvm.c"
|
|
|
|
#include "lua-5.3.4/lzio.c"
|
|
|
|
|
|
|
|
#include "lua-5.3.4/loadlib.c"
|
2016-02-13 16:31:17 -05:00
|
|
|
|
|
|
|
#if _MSC_VER
|
|
|
|
#pragma warning (pop)
|
|
|
|
#endif
|
|
|
|
|
2016-04-04 07:42:50 -04:00
|
|
|
} // end extern "C"
|
2016-02-13 16:31:17 -05:00
|
|
|
|
|
|
|
#if _MSC_VER
|
2016-04-04 07:42:50 -04:00
|
|
|
# pragma pop_macro("_CRT_SECURE_NO_WARNINGS")
|
|
|
|
#elif defined(__clang__)
|
|
|
|
# pragma clang diagnostic pop
|
|
|
|
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
|
|
|
# pragma GCC diagnostic pop
|
2016-02-13 16:31:17 -05:00
|
|
|
#endif
|