summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2017-07-19 05:44:19 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-07-19 05:44:19 +0000
commit0f169dac29df7fa6219fc5b2bee55a014acd7bd6 (patch)
tree07322d39533e292ebba9007c14db1895c6b71326 /include
parentc95b45c72ffc18145f3ef154f6b7ca00c90aab63 (diff)
parent47c479d9b9a915cd36c647bb768f1d9af5a9e75f (diff)
downloadnative-0f169dac29df7fa6219fc5b2bee55a014acd7bd6.tar.gz
Merge "_FILE_OFFSET_BITS=64 support for asset_manager.h."
am: 47c479d9b9 Change-Id: I8fcdb3ff9680b1fb7cc41a7bb5e91b71fd16abc5
Diffstat (limited to 'include')
-rw-r--r--include/android/asset_manager.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/android/asset_manager.h b/include/android/asset_manager.h
index 7ef3ecb595..2ac7d4d350 100644
--- a/include/android/asset_manager.h
+++ b/include/android/asset_manager.h
@@ -33,6 +33,10 @@
extern "C" {
#endif
+#if !defined(__ANDROID__) && !defined(__RENAME_IF_FILE_OFFSET64)
+#define __RENAME_IF_FILE_OFFSET64(x)
+#endif
+
struct AAssetManager;
/**
* {@link AAssetManager} provides access to an application's raw assets by
@@ -132,9 +136,9 @@ int AAsset_read(AAsset* asset, void* buf, size_t count);
*
* Returns the new position on success, or (off_t) -1 on error.
*/
-off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
+off_t AAsset_seek(AAsset* asset, off_t offset, int whence)
+ __RENAME_IF_FILE_OFFSET64(AAsset_seek64);
-#if __ANDROID_API__ >= 13
/**
* Seek to the specified offset within the asset data. 'whence' uses the
* same constants as lseek()/fseek().
@@ -145,7 +149,6 @@ off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
* Returns the new position on success, or (off64_t) -1 on error.
*/
off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence);
-#endif
/**
* Close the asset, freeing all associated resources.
@@ -162,29 +165,27 @@ const void* AAsset_getBuffer(AAsset* asset);
/**
* Report the total size of the asset data.
*/
-off_t AAsset_getLength(AAsset* asset);
+off_t AAsset_getLength(AAsset* asset)
+ __RENAME_IF_FILE_OFFSET64(AAsset_getLength64);
-#if __ANDROID_API__ >= 13
/**
* Report the total size of the asset data. Reports the size using a 64-bit
* number insted of 32-bit as AAsset_getLength.
*/
off64_t AAsset_getLength64(AAsset* asset);
-#endif
/**
* Report the total amount of asset data that can be read from the current position.
*/
-off_t AAsset_getRemainingLength(AAsset* asset);
+off_t AAsset_getRemainingLength(AAsset* asset)
+ __RENAME_IF_FILE_OFFSET64(AAsset_getRemainingLength64);
-#if __ANDROID_API__ >= 13
/**
* Report the total amount of asset data that can be read from the current position.
*
* Uses a 64-bit number instead of a 32-bit number as AAsset_getRemainingLength does.
*/
off64_t AAsset_getRemainingLength64(AAsset* asset);
-#endif
/**
* Open a new file descriptor that can be used to read the asset data. If the
@@ -194,9 +195,9 @@ off64_t AAsset_getRemainingLength64(AAsset* asset);
* Returns < 0 if direct fd access is not possible (for example, if the asset is
* compressed).
*/
-int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
+int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength)
+ __RENAME_IF_FILE_OFFSET64(AAsset_openFileDescriptor64);
-#if __ANDROID_API__ >= 13
/**
* Open a new file descriptor that can be used to read the asset data.
*
@@ -207,7 +208,6 @@ int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
* compressed).
*/
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
-#endif
/**
* Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not