diff options
author | Robin Gareus <robin@gareus.org> | 2016-04-11 22:19:25 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-04-11 22:19:25 +0200 |
commit | 8002b2d26e0191ec562fe2f5f2f42f51b03e9c30 (patch) | |
tree | 809a2cda6bf4adb7c535ab9cb31fc948ca4d4519 /libs/lua/LuaBridge | |
parent | 4eba3869feab704aaacbc3aee30407beedb128f2 (diff) |
special case luabridge for windows/MSVC
luabridge uses static fn addresses to identify classes.
Windows uses different addresses for *identical* static functions
in libardour.dll and ardour.exe
This solves the issue by moving the all functions from a
header-only implementation into libardour.
Diffstat (limited to 'libs/lua/LuaBridge')
-rw-r--r-- | libs/lua/LuaBridge/detail/ClassInfo.h | 10 | ||||
-rw-r--r-- | libs/lua/LuaBridge/detail/Userdata.h | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libs/lua/LuaBridge/detail/ClassInfo.h b/libs/lua/LuaBridge/detail/ClassInfo.h index 8639dbec52..2a0ab001fd 100644 --- a/libs/lua/LuaBridge/detail/ClassInfo.h +++ b/libs/lua/LuaBridge/detail/ClassInfo.h @@ -36,6 +36,15 @@ template <class T> class ClassInfo { public: +#ifdef PLATFORM_WINDOWS + /* static symbols on windows (even identical symbols) are not + * mapped to the same address when mixing .dll + .exe. + * the implementation is moved to libardour/gtk2_ardour. + */ + static void const* getStaticKey (); + static void const* getClassKey (); + static void const* getConstKey (); +#else /** Get the key for the static table. The static table holds the static data members, static properties, and @@ -69,5 +78,6 @@ public: static char value; return &value; } +#endif }; diff --git a/libs/lua/LuaBridge/detail/Userdata.h b/libs/lua/LuaBridge/detail/Userdata.h index c7ee3bac3e..a0bbf720d4 100644 --- a/libs/lua/LuaBridge/detail/Userdata.h +++ b/libs/lua/LuaBridge/detail/Userdata.h @@ -51,11 +51,15 @@ 6. Our metatables have "__metatable" set to a boolean = false. 7. Our lightuserdata is unique. */ +#ifdef PLATFORM_WINDOWS +extern void* getIdentityKey (); +#else inline void* getIdentityKey () { static char value; return &value; } +#endif /** Interface to a class pointer retrievable from a userdata. |