← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/util-jvm-windows-fix into lp:zorba/util-jvm-module

 

Ghislain Fourny has proposed merging lp:~zorba-coders/zorba/util-jvm-windows-fix into lp:zorba/util-jvm-module.

Requested reviews:
  Chris Hillery (ceejatec)
  Matthias Brantner (matthias-brantner)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/util-jvm-windows-fix/+merge/106777

Fixed DLL import which did not work under Windows.
-- 
https://code.launchpad.net/~zorba-coders/zorba/util-jvm-windows-fix/+merge/106777
Your team Zorba Coders is subscribed to branch lp:zorba/util-jvm-module.
=== modified file 'include/JavaVMSingleton.h'
--- include/JavaVMSingleton.h	2012-04-05 09:16:22 +0000
+++ include/JavaVMSingleton.h	2012-05-22 10:32:32 +0000
@@ -20,12 +20,33 @@
 #include <jni.h>
 #include <zorba/static_context.h>
 
+# if defined WIN32 || defined CYGWIN
+#   ifdef util_jvm_EXPORTS
+#     ifdef __GNUC__
+#       define UTIL_JVM_DLL_PUBLIC __attribute__((dllexport))
+#     else
+#       define UTIL_JVM_DLL_PUBLIC __declspec(dllexport)
+#     endif /* __GNUC__ */
+#   else /* util_jvm_EXPORTS */
+#     ifdef __GNUC__
+#       define UTIL_JVM_DLL_PUBLIC __attribute__((dllimport))
+#     else
+#       define UTIL_JVM_DLL_PUBLIC __declspec(dllimport)
+#     endif /* __GNUC__ */
+#   endif /* util_jvm_EXPORTS */
+# else
+#   if __GNUC__ >= 4
+#     define UTIL_JVM_DLL_PUBLIC __attribute__ ((visibility("default")))
+#   else
+#     define UTIL_JVM_DLL_PUBLIC
+#   endif
+# endif
 
 namespace zorba { namespace jvm {
 
 class VMOpenException {};
 
-class ZORBA_DLL_PUBLIC JavaVMSingleton
+class UTIL_JVM_DLL_PUBLIC JavaVMSingleton
 {
 public:
   static JavaVMSingleton* getInstance(const char* classPath);

=== modified file 'src/JavaVMSingleton.cpp'
--- src/JavaVMSingleton.cpp	2012-05-18 10:36:07 +0000
+++ src/JavaVMSingleton.cpp	2012-05-22 10:32:32 +0000
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "JavaVMSingleton.h"
+
 #include <fstream>
 #include <iostream>
 #include <istream>
@@ -22,7 +24,6 @@
 #include <cstring>
 #include <sstream>
 
-#include "JavaVMSingleton.h"
 #include <zorba/util/path.h>
 #include <zorba/util/file.h>
 #include <zorba/zorba.h>


Follow ups