From 6c7b5b5fe44cf23cf7ad42ce32abe1e29210622a Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Wed, 18 Aug 2010 11:39:03 -0700 Subject: [PATCH] Relying on fdlibm's build to set the version type to IEEE. This is necessary to support dalvikvm on a Linux x86 host. Change-Id: Ic85845f605616e4d3d2a3aa6bc317916d6217dac --- luni/src/main/native/java_lang_StrictMath.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/luni/src/main/native/java_lang_StrictMath.cpp b/luni/src/main/native/java_lang_StrictMath.cpp index d73185bf..86a79c9b 100644 --- a/luni/src/main/native/java_lang_StrictMath.cpp +++ b/luni/src/main/native/java_lang_StrictMath.cpp @@ -16,22 +16,18 @@ #define LOG_TAG "StrictMath" -#include "jni.h" -#include "JNIHelp.h" - -#include -/* This static way is the "best" way to integrate fdlibm without a conflict - * into the android environment. - */ - -#if defined(__P) -#undef __P -#endif /* defined(__P) */ - +// We include this header file first, because it's unhygienic when it comes to checking whether +// things are already #defined. It's also missing the 'extern "C"', and leaves a bunch of stuff. extern "C" { #include "../../external/fdlibm/fdlibm.h" } -_LIB_VERSION_TYPE _LIB_VERSION = _IEEE_; +// fdlibm.h #defines __P. glibc uses #undef itself to supply its own definition, but bionic +// assumes no-one's been polluting the namespace. +#undef __P + +#include "jni.h" +#include "JNIHelp.h" +#include "JniConstants.h" static jdouble StrictMath_sin(JNIEnv*, jclass, jdouble a) { return ieee_sin(a); -- 2.11.0