diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-18 09:56:44 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-19 15:57:52 +0100 |
commit | 37e9658f74f9421aaae5fe71f12eb2221f2d574a (patch) | |
tree | f55aeab48b2b4edf3267aaf1f5459d52c9b7aa36 /deep_test/deep_test.c | |
parent | 352c7bec48f166e34fa94f7481882a8b5958e15c (diff) | |
download | lanes-37e9658f74f9421aaae5fe71f12eb2221f2d574a.tar.gz lanes-37e9658f74f9421aaae5fe71f12eb2221f2d574a.tar.bz2 lanes-37e9658f74f9421aaae5fe71f12eb2221f2d574a.zip |
C++ migration: buildfixes
Essentially, buildfixes when compiling as C++, plus properly marking public API as extern "C"
Diffstat (limited to 'deep_test/deep_test.c')
-rw-r--r-- | deep_test/deep_test.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/deep_test/deep_test.c b/deep_test/deep_test.c index cb89741..eca7479 100644 --- a/deep_test/deep_test.c +++ b/deep_test/deep_test.c | |||
@@ -9,12 +9,6 @@ | |||
9 | #include "lanes/src/deep.h" | 9 | #include "lanes/src/deep.h" |
10 | #include "lanes/src/compat.h" | 10 | #include "lanes/src/compat.h" |
11 | 11 | ||
12 | #if (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) | ||
13 | #define LANES_API __declspec(dllexport) | ||
14 | #else | ||
15 | #define LANES_API | ||
16 | #endif // (defined PLATFORM_WIN32) || (defined PLATFORM_POCKETPC) | ||
17 | |||
18 | // ################################################################################################ | 12 | // ################################################################################################ |
19 | 13 | ||
20 | // a lanes-deep userdata. needs DeepPrelude and luaG_newdeepuserdata from Lanes code. | 14 | // a lanes-deep userdata. needs DeepPrelude and luaG_newdeepuserdata from Lanes code. |
@@ -248,7 +242,7 @@ static luaL_Reg const deep_module[] = | |||
248 | 242 | ||
249 | // ################################################################################################ | 243 | // ################################################################################################ |
250 | 244 | ||
251 | extern int __declspec(dllexport) luaopen_deep_test(lua_State* L) | 245 | LANES_API int luaopen_deep_test(lua_State* L) |
252 | { | 246 | { |
253 | luaL_newlib( L, deep_module); // M | 247 | luaL_newlib( L, deep_module); // M |
254 | 248 | ||
@@ -256,18 +250,18 @@ extern int __declspec(dllexport) luaopen_deep_test(lua_State* L) | |||
256 | if( luaL_newmetatable( L, "clonable")) // M mt | 250 | if( luaL_newmetatable( L, "clonable")) // M mt |
257 | { | 251 | { |
258 | luaL_setfuncs( L, clonable_mt, 0); | 252 | luaL_setfuncs( L, clonable_mt, 0); |
259 | lua_pushvalue(L, -1); // M mt mt | 253 | lua_pushvalue(L, -1); // M mt mt |
260 | lua_setfield(L, -2, "__index"); // M mt | 254 | lua_setfield(L, -2, "__index"); // M mt |
261 | } | 255 | } |
262 | lua_setfield(L, -2, "__clonableMT"); // M | 256 | lua_setfield(L, -2, "__clonableMT"); // M |
263 | 257 | ||
264 | if( luaL_newmetatable( L, "deep")) // mt | 258 | if( luaL_newmetatable( L, "deep")) // mt |
265 | { | 259 | { |
266 | luaL_setfuncs( L, deep_mt, 0); | 260 | luaL_setfuncs( L, deep_mt, 0); |
267 | lua_pushvalue(L, -1); // mt mt | 261 | lua_pushvalue(L, -1); // mt mt |
268 | lua_setfield(L, -2, "__index"); // mt | 262 | lua_setfield(L, -2, "__index"); // mt |
269 | } | 263 | } |
270 | lua_setfield(L, -2, "__deepMT"); // M | 264 | lua_setfield(L, -2, "__deepMT"); // M |
271 | 265 | ||
272 | return 1; | 266 | return 1; |
273 | } | 267 | } |