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
This commit is contained in:
Andrew Hsieh
2013-10-16 16:26:26 +08:00
parent a36935be21
commit 5881b5cbe7
20 changed files with 1064 additions and 985 deletions

View File

@@ -579,23 +579,23 @@ int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event);
* For touch events on the screen, this is the delta that was added to the raw
* screen coordinates to adjust for the absolute position of the containing windows
* and views. */
float AMotionEvent_getXOffset(const AInputEvent* motion_event);
float AMotionEvent_getXOffset(const AInputEvent* motion_event) __NDK_FPABI__;
/* Get the precision of the Y coordinates being reported.
* For touch events on the screen, this is the delta that was added to the raw
* screen coordinates to adjust for the absolute position of the containing windows
* and views. */
float AMotionEvent_getYOffset(const AInputEvent* motion_event);
float AMotionEvent_getYOffset(const AInputEvent* motion_event) __NDK_FPABI__;
/* Get the precision of the X coordinates being reported.
* You can multiply this number with an X coordinate sample to find the
* actual hardware value of the X coordinate. */
float AMotionEvent_getXPrecision(const AInputEvent* motion_event);
float AMotionEvent_getXPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
/* Get the precision of the Y coordinates being reported.
* You can multiply this number with a Y coordinate sample to find the
* actual hardware value of the Y coordinate. */
float AMotionEvent_getYPrecision(const AInputEvent* motion_event);
float AMotionEvent_getYPrecision(const AInputEvent* motion_event) __NDK_FPABI__;
/* Get the number of pointers of data contained in this event.
* Always >= 1. */
@@ -616,29 +616,29 @@ int32_t AMotionEvent_getToolType(const AInputEvent* motion_event, size_t pointer
* For touch events on the screen, this is the original location of the event
* on the screen, before it had been adjusted for the containing window
* and views. */
float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the original raw X coordinate of this event.
* For touch events on the screen, this is the original location of the event
* on the screen, before it had been adjusted for the containing window
* and views. */
float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current X coordinate of this event for the given pointer index.
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current Y coordinate of this event for the given pointer index.
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current pressure of this event for the given pointer index.
* The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
* although values higher than 1 may be generated depending on the calibration of
* the input device. */
float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current scaled value of the approximate size for the given pointer index.
* This represents some approximation of the area of the screen being
@@ -646,27 +646,27 @@ float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_i
* touch is normalized with the device specific range of values
* and scaled to a value between 0 and 1. The value of size can be used to
* determine fat touch events. */
float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current length of the major axis of an ellipse that describes the touch area
* at the point of contact for the given pointer index. */
float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current length of the minor axis of an ellipse that describes the touch area
* at the point of contact for the given pointer index. */
float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current length of the major axis of an ellipse that describes the size
* of the approaching tool for the given pointer index.
* The tool area represents the estimated size of the finger or pen that is
* touching the device independent of its actual touch area at the point of contact. */
float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current length of the minor axis of an ellipse that describes the size
* of the approaching tool for the given pointer index.
* The tool area represents the estimated size of the finger or pen that is
* touching the device independent of its actual touch area at the point of contact. */
float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the current orientation of the touch area and tool area in radians clockwise from
* vertical for the given pointer index.
@@ -676,11 +676,11 @@ float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_
* indicates that the major axis of contact is oriented to the left.
* The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
* (finger pointing fully right). */
float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index);
float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index) __NDK_FPABI__;
/* Get the value of the request axis for the given pointer index. */
float AMotionEvent_getAxisValue(const AInputEvent* motion_event,
int32_t axis, size_t pointer_index);
int32_t axis, size_t pointer_index) __NDK_FPABI__;
/* Get the number of historical points in this event. These are movements that
* have occurred between this event and the previous event. This only applies
@@ -701,7 +701,7 @@ int64_t AMotionEvent_getHistoricalEventTime(const AInputEvent* motion_event,
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical raw Y coordinate of this event for the given pointer index that
* occurred between this event and the previous motion event.
@@ -711,21 +711,21 @@ float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t poi
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical X coordinate of this event for the given pointer index that
* occurred between this event and the previous motion event.
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getHistoricalX(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical Y coordinate of this event for the given pointer index that
* occurred between this event and the previous motion event.
* Whole numbers are pixels; the value may have a fraction for input devices
* that are sub-pixel precise. */
float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical pressure of this event for the given pointer index that
* occurred between this event and the previous motion event.
@@ -733,7 +733,7 @@ float AMotionEvent_getHistoricalY(const AInputEvent* motion_event, size_t pointe
* although values higher than 1 may be generated depending on the calibration of
* the input device. */
float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the current scaled value of the approximate size for the given pointer index that
* occurred between this event and the previous motion event.
@@ -743,19 +743,19 @@ float AMotionEvent_getHistoricalPressure(const AInputEvent* motion_event, size_t
* and scaled to a value between 0 and 1. The value of size can be used to
* determine fat touch events. */
float AMotionEvent_getHistoricalSize(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical length of the major axis of an ellipse that describes the touch area
* at the point of contact for the given pointer index that
* occurred between this event and the previous motion event. */
float AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical length of the minor axis of an ellipse that describes the touch area
* at the point of contact for the given pointer index that
* occurred between this event and the previous motion event. */
float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical length of the major axis of an ellipse that describes the size
* of the approaching tool for the given pointer index that
@@ -763,7 +763,7 @@ float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size
* The tool area represents the estimated size of the finger or pen that is
* touching the device independent of its actual touch area at the point of contact. */
float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical length of the minor axis of an ellipse that describes the size
* of the approaching tool for the given pointer index that
@@ -771,7 +771,7 @@ float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_
* The tool area represents the estimated size of the finger or pen that is
* touching the device independent of its actual touch area at the point of contact. */
float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical orientation of the touch area and tool area in radians clockwise from
* vertical for the given pointer index that
@@ -783,12 +783,12 @@ float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_
* The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
* (finger pointing fully right). */
float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
size_t history_index);
size_t history_index) __NDK_FPABI__;
/* Get the historical value of the request axis for the given pointer index
* that occurred between this event and the previous motion event. */
float AMotionEvent_getHistoricalAxisValue(const AInputEvent* motion_event,
int32_t axis, size_t pointer_index, size_t history_index);
int32_t axis, size_t pointer_index, size_t history_index) __NDK_FPABI__;
/*