From e5b009c563b4b663f40dac9126ac7d77de88fe12 Mon Sep 17 00:00:00 2001 From: elias Date: Sat, 15 Jul 2006 22:39:32 +0000 Subject: [PATCH] Windows: Added build.xml.mingw for building with mingw compiler. Doesn't work yet since the RawInput API is not supported through mingw yet. --- plugins/common/src/native/util.c | 2 +- plugins/common/src/native/util.h | 5 ++ plugins/windows/src/native/build.xml.mingw | 80 +++++++++++++++++++ .../native/net_java_games_input_DummyWindow.c | 2 +- 4 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 plugins/windows/src/native/build.xml.mingw diff --git a/plugins/common/src/native/util.c b/plugins/common/src/native/util.c index 745a265..089ba17 100644 --- a/plugins/common/src/native/util.c +++ b/plugins/common/src/native/util.c @@ -46,7 +46,7 @@ static jstring sprintfJavaString(JNIEnv *env, const char *format, va_list ap) { #define BUFFER_SIZE 4000 char buffer[BUFFER_SIZE]; jstring str; -#ifdef _WIN32 +#ifdef _MSC_VER vsnprintf_s(buffer, BUFFER_SIZE, _TRUNCATE, format, ap); #else vsnprintf(buffer, BUFFER_SIZE, format, ap); diff --git a/plugins/common/src/native/util.h b/plugins/common/src/native/util.h index 58a62f4..657a93d 100644 --- a/plugins/common/src/native/util.h +++ b/plugins/common/src/native/util.h @@ -40,6 +40,11 @@ #include #include #include +#ifdef _MSC_VER +#include +#else +#include +#endif extern void printfJava(JNIEnv *env, const char *format, ...); extern void throwRuntimeException(JNIEnv * env, const char *format, ...); diff --git a/plugins/windows/src/native/build.xml.mingw b/plugins/windows/src/native/build.xml.mingw new file mode 100644 index 0000000..af034be --- /dev/null +++ b/plugins/windows/src/native/build.xml.mingw @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/windows/src/native/net_java_games_input_DummyWindow.c b/plugins/windows/src/native/net_java_games_input_DummyWindow.c index 539e45c..1aa1832 100644 --- a/plugins/windows/src/native/net_java_games_input_DummyWindow.c +++ b/plugins/windows/src/native/net_java_games_input_DummyWindow.c @@ -59,7 +59,7 @@ JNIEXPORT jlong JNICALL Java_net_java_games_input_DummyWindow_createWindow(JNIEn throwIOException(env, "Failed to create window (%d)\n", GetLastError()); return 0; } - return (jlong)hwndDummy; + return (jlong)(intptr_t)hwndDummy; } JNIEXPORT void JNICALL Java_net_java_games_input_DummyWindow_nDestroy(JNIEnv *env, jclass unused, jlong hwnd_address) {