Fix aapt2 build break on MacOS
In ag/25343121 the include statements were sorted for
'androidfw/ResourceTypes.h'. This reordering unfortunately caused a
build break for aapt2 on host MacOS.
The issue was that 'android/configuration.h' includes
'android/asset_manager.h', which references off64_t, a type that is not
available on MacOS.
Previously, the 'android/configuration.h' include occurred after
'androidfw/Asset.h', which transitively included
'android-base/off64_t.h', leading to the definition of off64_t.
Add a typedef for off64_t for Darwin in asset_manager.h. An alternative
approach would be include 'android-base/off64_t.h' in asset_manager.h,
but adding a dependency to libbase seems excessive for this change.
Test: m libnativehelper aapt2 on Mac
Bug: 321309980
Change-Id: Ie67f4256c4ca309bf6eb4a2a2fc28de2155041f5
diff --git a/include/android/asset_manager.h b/include/android/asset_manager.h
index 2ac7d4d..6420cd0 100644
--- a/include/android/asset_manager.h
+++ b/include/android/asset_manager.h
@@ -29,6 +29,10 @@
#include <sys/cdefs.h>
#include <sys/types.h>
+#if defined(__APPLE__)
+typedef off_t off64_t; // Mac OSX does not define off64_t
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif