summaryrefslogtreecommitdiff
path: root/gtk2_ardour/luainstance.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-12-03 02:27:44 +0100
committerRobin Gareus <robin@gareus.org>2019-12-03 02:27:44 +0100
commit1caef183bf016d366f24f3dd4bd8b5c220cdb390 (patch)
treebd075e8ade47d4b073aa245680da8f4f055ec9c9 /gtk2_ardour/luainstance.cc
parente3544db3aa8cbe0f5ebe4395b5f893d0beaddc03 (diff)
Fix Windows builds
This fixes a missing symbol error due to the weird way how Windows maps the same, identical symbols using different addresses in .dll and .exe. Here specifically for int luabridge::CFunc::vectorToArray<double, std::vector<double, std::allocator<double> > >(lua_State*) which was added in 5e1a73a28c07 resulting in gtk2_ardour/luainstance.cc error: explicit instantiation of 'static const void* luabridge::ClassInfo<T>::getStaticKey() [with T = std::vector<double>]' but no definition available [-fpermissive] gtk2_ardour/luainstance.cc error: explicit instantiation of 'static const void* luabridge::ClassInfo<T>::getClassKey() [with T = std::vector<double>]' but no definition available [-fpermissive] gtk2_ardour/luainstance.cc error: explicit instantiation of 'static const void* luabridge::ClassInfo<T>::getConstKey() [with T = std::vector<double>]' but no definition available [-fpermissive]
Diffstat (limited to 'gtk2_ardour/luainstance.cc')
-rw-r--r--gtk2_ardour/luainstance.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/gtk2_ardour/luainstance.cc b/gtk2_ardour/luainstance.cc
index fa858888a3..12c474229e 100644
--- a/gtk2_ardour/luainstance.cc
+++ b/gtk2_ardour/luainstance.cc
@@ -62,6 +62,36 @@
static const char* ui_scripts_file_name = "ui_scripts";
+#ifdef PLATFORM_WINDOWS
+/* see libs/ardour/luabindings.cc for details */
+
+template <class T>
+void const*
+luabridge::ClassInfo<T>::getStaticKey ()
+{
+ static char value;
+ return &value;
+}
+
+template <class T>
+void const*
+luabridge::ClassInfo<T>::getClassKey ()
+{
+ static char value;
+ return &value;
+}
+
+template <class T>
+void const*
+luabridge::ClassInfo<T>::getConstKey ()
+{
+ static char value;
+ return &value;
+}
+
+CLASSKEYS(std::vector<double>);
+#endif
+
namespace LuaCairo {
/** wrap RefPtr< Cairo::ImageSurface >
*