diff options
| author | Raphael Moll <ralf@android.com> | 2011-02-16 13:36:42 -0800 |
|---|---|---|
| committer | Raphael Moll <ralf@android.com> | 2011-02-16 13:36:42 -0800 |
| commit | bd70e4aca5680acb7d5da5500b7e8c618fb499f2 (patch) | |
| tree | 2ad356887972215321e9b1f7ddcd94e460239ae2 /include/arch | |
| parent | 034117e47f2601d46563461a0bfe3cc22f89a0f0 (diff) | |
| download | core-bd70e4aca5680acb7d5da5500b7e8c618fb499f2.tar.gz core-bd70e4aca5680acb7d5da5500b7e8c618fb499f2.tar.bz2 core-bd70e4aca5680acb7d5da5500b7e8c618fb499f2.zip | |
Define O_BINARY for non-Windows platforms.
All tools (aapt, aidl, dexdump, etc.) need this flag to open()
binary files, or they risk reading corrupted data on Windows.
A bunch of these tools just conditionaly define O_BINARY in
their C files. Seems it would just make sense to define it globally.
Change-Id: Ia5c0a59e9e77bbdcbce235233555f611207abed8
Diffstat (limited to 'include/arch')
| -rw-r--r-- | include/arch/darwin-x86/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/freebsd-x86/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/linux-arm/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/linux-ppc/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/linux-sh/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/linux-x86/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/target_linux-x86/AndroidConfig.h | 8 | ||||
| -rw-r--r-- | include/arch/windows/AndroidConfig.h | 6 |
8 files changed, 62 insertions, 0 deletions
diff --git a/include/arch/darwin-x86/AndroidConfig.h b/include/arch/darwin-x86/AndroidConfig.h index 2bb44c6ae..9914bd5e8 100644 --- a/include/arch/darwin-x86/AndroidConfig.h +++ b/include/arch/darwin-x86/AndroidConfig.h @@ -300,4 +300,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/freebsd-x86/AndroidConfig.h b/include/arch/freebsd-x86/AndroidConfig.h index 992b6895b..ed5af595e 100644 --- a/include/arch/freebsd-x86/AndroidConfig.h +++ b/include/arch/freebsd-x86/AndroidConfig.h @@ -358,4 +358,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/linux-arm/AndroidConfig.h b/include/arch/linux-arm/AndroidConfig.h index 5b7ccee1b..c70618d15 100644 --- a/include/arch/linux-arm/AndroidConfig.h +++ b/include/arch/linux-arm/AndroidConfig.h @@ -354,4 +354,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/linux-ppc/AndroidConfig.h b/include/arch/linux-ppc/AndroidConfig.h index 2c443d147..91af62983 100644 --- a/include/arch/linux-ppc/AndroidConfig.h +++ b/include/arch/linux-ppc/AndroidConfig.h @@ -318,4 +318,12 @@ */ #define HAVE_PREAD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/linux-sh/AndroidConfig.h b/include/arch/linux-sh/AndroidConfig.h index 0dd7b3b32..622ca50ab 100644 --- a/include/arch/linux-sh/AndroidConfig.h +++ b/include/arch/linux-sh/AndroidConfig.h @@ -361,4 +361,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/linux-x86/AndroidConfig.h b/include/arch/linux-x86/AndroidConfig.h index 24f6cccec..26dcf1fc0 100644 --- a/include/arch/linux-x86/AndroidConfig.h +++ b/include/arch/linux-x86/AndroidConfig.h @@ -328,4 +328,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /*_ANDROID_CONFIG_H*/ diff --git a/include/arch/target_linux-x86/AndroidConfig.h b/include/arch/target_linux-x86/AndroidConfig.h index d6ce3f222..9b357d948 100644 --- a/include/arch/target_linux-x86/AndroidConfig.h +++ b/include/arch/target_linux-x86/AndroidConfig.h @@ -345,4 +345,12 @@ */ #define HAVE_PRINTF_ZD 1 +/* + * We need to open binary files using O_BINARY on Windows. + * Most systems lack (and actually don't need) this flag. + */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #endif /* _ANDROID_CONFIG_H */ diff --git a/include/arch/windows/AndroidConfig.h b/include/arch/windows/AndroidConfig.h index f0bf56f78..17c84c7c5 100644 --- a/include/arch/windows/AndroidConfig.h +++ b/include/arch/windows/AndroidConfig.h @@ -333,4 +333,10 @@ */ /* #define HAVE_PRINTF_ZD 1 */ +/* + * We need to open binary files using O_BINARY on Windows. + * We don't define it on Windows since it is part of the io headers. + */ +/* #define O_BINARY 0 */ + #endif /*_ANDROID_CONFIG_H*/ |
