|
1 | | -/* MIT License |
2 | | - * |
3 | | - * Copyright (c) 2017-2018 Cody Tilkins |
4 | | - * |
5 | | - * Permission is hereby granted, free of charge, to any person obtaining a copy |
6 | | - * of this software and associated documentation files (the "Software"), to deal |
7 | | - * in the Software without restriction, including without limitation the rights |
8 | | - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
9 | | - * copies of the Software, and to permit persons to whom the Software is |
10 | | - * furnished to do so, subject to the following conditions: |
11 | | - * |
12 | | - * The above copyright notice and this permission notice shall be included in all |
13 | | - * copies or substantial portions of the Software. |
14 | | - * |
15 | | - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
16 | | - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
17 | | - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
18 | | - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
19 | | - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
20 | | - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
21 | | - * SOFTWARE. |
22 | | - */ |
23 | | - |
24 | | -#pragma once |
25 | | - |
26 | | -#if defined(linux) || defined(__linux__) || defined(__linux) |
27 | | -# define LUA_DLL __attribute__((visibility("default"))) |
28 | | -#elif defined(unix) || defined(__unix__) || defined(__unix) |
29 | | -# define LUA_DLL __attribute__((visibility("default"))) |
30 | | -#elif defined(__APPLE__) || defined(__MACH__) |
31 | | -# define LUA_DLL __attribute__((visibility("default"))) |
32 | | -#elif defined(_WIN32) || defined(_WIN64) |
33 | | -# define LUA_DLL __declspec(dllexport) |
34 | | -#else |
35 | | -# error "OS not familiar. Set up headers accordingly, or -D__linux__ of -Dunix or -D__APPLE__ or -D_WIN32" |
36 | | -#endif |
37 | | - |
38 | | - |
39 | | -// Please migrate your lua h's to a proper directory so versions don't collide |
40 | | -// luajit make install puts them in /usr/local/include/luajit-X.X/* |
41 | | -// lua51/52/53 puts them directly in /usr/local/include/* with version collision |
42 | | -#if defined(LUA_51) |
43 | | -# include "lua51/lua.h" |
44 | | -# include "lua51/lualib.h" |
45 | | -# include "lua51/lauxlib.h" |
46 | | -#elif defined(LUA_52) |
47 | | -# include "lua52/lua.h" |
48 | | -# include "lua52/lualib.h" |
49 | | -# include "lua52/lauxlib.h" |
50 | | -#elif defined(LUA_53) |
51 | | -# include "lua53/lua.h" |
52 | | -# include "lua53/lualib.h" |
53 | | -# include "lua53/lauxlib.h" |
54 | | -#elif defined(LUA_JIT_51) |
55 | | -# include "luajit-2.0/lua.h" |
56 | | -# include "luajit-2.0/lualib.h" |
57 | | -# include "luajit-2.0/lauxlib.h" |
58 | | -# include "luajit-2.0/luajit.h" |
59 | | -#else |
60 | | -# warning "Lua version not defined." |
61 | | -# error "Define the version to use. '-DLUA_53' '-DLUA_52' '-DLUA_51' '-DLUA_JIT_51'" |
62 | | -#endif |
63 | | - |
64 | | - |
65 | | - |
66 | | -#define LUA_DLL_ENTRY LUA_DLL int |
67 | | - |
68 | | - |
69 | | -LUA_DLL_ENTRY luaopen_luaadd(lua_State* L); |
70 | | - |
| 1 | +/* MIT License |
| 2 | + * |
| 3 | + * Copyright (c) 2017-2018 Cody Tilkins |
| 4 | + * |
| 5 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | + * of this software and associated documentation files (the "Software"), to deal |
| 7 | + * in the Software without restriction, including without limitation the rights |
| 8 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | + * copies of the Software, and to permit persons to whom the Software is |
| 10 | + * furnished to do so, subject to the following conditions: |
| 11 | + * |
| 12 | + * The above copyright notice and this permission notice shall be included in all |
| 13 | + * copies or substantial portions of the Software. |
| 14 | + * |
| 15 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 21 | + * SOFTWARE. |
| 22 | + */ |
| 23 | + |
| 24 | +#pragma once |
| 25 | + |
| 26 | + |
| 27 | +#if defined(_WIN32) || defined(_WIN64) |
| 28 | +# define LUA_DLL __declspec(dllexport) |
| 29 | +#else |
| 30 | +# define LUA_DLL __attribute__((visibility("default"))) |
| 31 | +#endif |
| 32 | + |
| 33 | + |
| 34 | +// compiler/project includes |
| 35 | +// Please migrate your lua h's to a proper local directory so versions don't collide |
| 36 | +// luajit `make install` puts them in /usr/local/include/luajit-X.X/* |
| 37 | +// lua51/52/53 `make install` puts them in /usr/local/include/* with version collision |
| 38 | +#include "lua.h" |
| 39 | +#include "lualib.h" |
| 40 | +#include "lauxlib.h" |
| 41 | +#if defined(LUA_JIT_51) |
| 42 | +# include "jitsupport.h" |
| 43 | +#endif |
| 44 | + |
| 45 | + |
| 46 | +#define LUA_DLL_ENTRY LUA_DLL int |
| 47 | + |
| 48 | + |
| 49 | +LUA_DLL_ENTRY luaopen_luaadd(lua_State* L); |
| 50 | + |
0 commit comments