From b59d234b1661d504258ef3780c7337278ac62e32 Mon Sep 17 00:00:00 2001 From: Eric Scharff Date: Thu, 11 Oct 2007 09:59:22 -0600 Subject: [PATCH] Math.floor() is used by SWT. Defers to the libm (or GCC builtin) for floor --- classpath/java-lang.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/classpath/java-lang.cpp b/classpath/java-lang.cpp index 6f680f12e7..87d28d5c21 100644 --- a/classpath/java-lang.cpp +++ b/classpath/java-lang.cpp @@ -70,8 +70,15 @@ Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name) return r; } +#include +extern "C" JNIEXPORT jdouble JNICALL +Java_java_lang_Math_floor(JNIEnv*, jclass, jdouble val) +{ + return floor(val); +} + extern "C" JNIEXPORT jint JNICALL -Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass, jdouble val, +Java_java_lang_Double_fillBufferWithDouble(JNIEnv* e, jclass, jdouble val, jbyteArray buffer, jint bufferSize) { jboolean isCopy; jbyte* buf = e->GetByteArrayElements(buffer, &isCopy);