Commit Graph

5 Commits

Author SHA1 Message Date
Andrew Hsieh
fbb32955a4 Fixed asset_manager.h, rect_manager.h, and jni.h
1. Fixed missing #include <sys/types.h> in android/asset_manager.h for API >= 13
2. Fixed missing #include <stdint.h> in android/rect_manager.h for API >= 14
3. Added JNICALL to JNI_OnLoad and JNI_OnUnload in jni.h

Change-Id: I875ec0b6e6f7c2f433c176f0a738eb78f3c33062
2014-01-08 14:10:06 +08:00
Andrew Hsieh
b05e7c1985 Annotate JNICALL with __NDK_FPABI__
In armeabi-v7a, VM still expects JNI functions to follow soft-abi.
Annotate it with __NDK_FPABI__ so compiler follows soft-abi in JNI
functions regardless the presence of -mhard-float in command-line.

It's up to developer to apply JNICALL consistently on JNI functions,
ie. those functions whose first arg has type "JNIEnv*" is likely to be

Change-Id: Ica7cca8ab9498ce00de6ffc7fff35f8cc13aedbf
2013-12-04 11:55:17 +08:00
Andrew Hsieh
5881b5cbe7 Add __NDK_FPABI__ to function taking/returning float/double
Allow user code to be compiled with "-mhard-float" for armeabi-v7a
(which implies -mfloat-abi=hard), and either link with
1. Android native APIs which use softfp, or
2. A customized libm_hard.a which is compiled with -mhard-float. Need
   -D_NDK_MATH_NO_SOFTFP=1

See tests/device/hard-float/jni/Android.mk for details and restriction
on Clang

Change-Id: I773a842c73368e08b9a6cda0441e95a96fa303b2
2013-10-17 19:15:22 +08:00
David 'Digit' Turner
bb3784d646 ndk: update JNIEXPORT declaration in <jni.h>
This patch updates the definition of JNIEXPORT in <jni.h> to
use the "default" ELF visibility attribute for JNI_OnLoad and
any function that uses the macro for its definition.

This is handy when a developer wants to use hidden visibility
by default by using a compiler flag like -fvisibility=hidden
in its Android.mk or custom build script.

Change-Id: I95112932731216a9a4986820a1875edfb3f52e5b
2011-08-23 16:08:17 +02:00
David 'Digit' Turner
7012117d4a Unify NDK platform headers.
This commit removes duplication of system headers per platform, i.e. remove
copies of common headers like <stdlib.h> from arch-arm/usr/include and arch-x86/usr/include
and move them to a common include directory. More specifically:

- common headers:        android-N/arch-A/usr/include --> android-N/include
- arch-specific headers: android-N/arch-A/usr-include --> android-N/arch-A/include
- arch-specific libs:    android-N/arch-A/usr/lib     --> android-N/arch-A/lib

Change-Id: Ifdba5038d108901931f3e3a7c14ebe6270d2d276

NOTE: This also contains careful separation of API-level-specific headers.
      For example, platforms/android-5/include/pthread.h contains new function
      declarations that are not available when using platforms/android-3/include/pthread.h

NOTE: The NDK's build-platforms.sh script has been updated to understand the new
      layout. This change in develeopment/ndk does not change the layout of
      platform files under $NDK/platforms after build-platforms.sh is called.
2010-09-22 18:04:36 +02:00