diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index 21c11ecea0..a91067a3da 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -34,9 +34,6 @@ # define CREAT creat # define UNLINK unlink # define OPEN_MASK 0 - -# undef JNIEXPORT -# define JNIEXPORT __attribute__ ((visibility("default"))) #endif namespace { diff --git a/classpath/java-lang.cpp b/classpath/java-lang.cpp index fd2f6d10bc..b377e0859a 100644 --- a/classpath/java-lang.cpp +++ b/classpath/java-lang.cpp @@ -11,12 +11,6 @@ #ifdef WIN32 # include "windows.h" -#else -# undef JNIEXPORT -# define JNIEXPORT __attribute__ ((visibility("default"))) -#endif - -#ifdef WIN32 # define SO_PREFIX "" #else # define SO_PREFIX "lib" diff --git a/classpath/java-util-zip.cpp b/classpath/java-util-zip.cpp index 47cdfeefa9..f18769766e 100644 --- a/classpath/java-util-zip.cpp +++ b/classpath/java-util-zip.cpp @@ -5,11 +5,6 @@ #include "jni.h" #include "jni-util.h" -#ifndef WIN32 -# undef JNIEXPORT -# define JNIEXPORT __attribute__ ((visibility("default"))) -#endif - extern "C" JNIEXPORT jlong JNICALL Java_java_util_zip_Inflater_make (JNIEnv* e, jclass, jboolean nowrap) diff --git a/classpath/jni-util.h b/classpath/jni-util.h index 5a5d7bf81f..00778c85cd 100644 --- a/classpath/jni-util.h +++ b/classpath/jni-util.h @@ -1,6 +1,13 @@ #ifndef JNI_UTIL #define JNI_UTIL +#undef JNIEXPORT +#ifdef __MINGW32__ +# define JNIEXPORT __declspec(dllexport) +#else +# define JNIEXPORT __attribute__ ((visibility("default"))) +#endif + namespace { inline void