From c3a8ca505c8941161d338d8409beb51bfc8c9491 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 3 Aug 2009 10:56:43 -0600 Subject: [PATCH] avoid function pointer cast warning from GCC 3.4 --- src/builtin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/builtin.cpp b/src/builtin.cpp index 1da1b7ee62..712dabce0f 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -78,7 +78,9 @@ runOnLoadIfFound(Thread* t, System::Library* library) { void* p = library->resolve("JNI_OnLoad"); if (p) { - reinterpret_cast(p)(t->m, 0); + jint (JNICALL * JNI_OnLoad)(Machine*, void*); + memcpy(&JNI_OnLoad, &p, sizeof(void*)); + JNI_OnLoad(t->m, 0); } }