Fix instances of '#if __LP64__'.

Triggers -Wundef, which is on in -Weverything.

Bug: http://b/31496165
Change-Id: Ib06107073f7dd1d584c19c222d0430da9d35630b
This commit is contained in:
Josh Gao 2016-09-15 13:55:41 -07:00
parent 5622837301
commit b36efa4343
16 changed files with 20 additions and 20 deletions

View File

@ -29,7 +29,7 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#if __LP64__ #if defined(__LP64__)
static void* __bionic_brk; static void* __bionic_brk;
#else #else
void* __bionic_brk; // Accidentally exported by the NDK. void* __bionic_brk; // Accidentally exported by the NDK.

View File

@ -113,7 +113,7 @@ int __isnormalf(float f) {
} }
__strong_alias(isnormalf, __isnormalf); __strong_alias(isnormalf, __isnormalf);
#if __LP64__ #if defined(__LP64__)
// LP64 uses 128-bit long doubles. // LP64 uses 128-bit long doubles.

View File

@ -37,7 +37,7 @@
#include <sys/vfs.h> #include <sys/vfs.h>
#include <unistd.h> #include <unistd.h>
#if __LP64__ #if defined(__LP64__)
#error This code is only needed on 32-bit systems! #error This code is only needed on 32-bit systems!
#endif #endif

View File

@ -36,7 +36,7 @@
extern "C" int __openat(int, const char*, int, int); extern "C" int __openat(int, const char*, int, int);
static inline int force_O_LARGEFILE(int flags) { static inline int force_O_LARGEFILE(int flags) {
#if __LP64__ #if defined(__LP64__)
return flags; // No need, and aarch64's strace gets confused. return flags; // No need, and aarch64's strace gets confused.
#else #else
return flags | O_LARGEFILE; return flags | O_LARGEFILE;

View File

@ -101,7 +101,7 @@ int __init_thread(pthread_internal_t* thread) {
sched_param param; sched_param param;
param.sched_priority = thread->attr.sched_priority; param.sched_priority = thread->attr.sched_priority;
if (sched_setscheduler(thread->tid, thread->attr.sched_policy, &param) == -1) { if (sched_setscheduler(thread->tid, thread->attr.sched_policy, &param) == -1) {
#if __LP64__ #if defined(__LP64__)
// For backwards compatibility reasons, we only report failures on 64-bit devices. // For backwards compatibility reasons, we only report failures on 64-bit devices.
error = errno; error = errno;
#endif #endif

View File

@ -20,7 +20,7 @@
// Paper over the fact that 32-bit kernels use fstatfs64/statfs64 with an extra argument, // Paper over the fact that 32-bit kernels use fstatfs64/statfs64 with an extra argument,
// but 64-bit kernels don't have the "64" bit suffix or the extra size_t argument. // but 64-bit kernels don't have the "64" bit suffix or the extra size_t argument.
#if __LP64__ #if defined(__LP64__)
extern "C" int __fstatfs(int, struct statfs*); extern "C" int __fstatfs(int, struct statfs*);
extern "C" int __statfs(const char*, struct statfs*); extern "C" int __statfs(const char*, struct statfs*);
# define __fstatfs64(fd,size,buf) __fstatfs(fd,buf) # define __fstatfs64(fd,size,buf) __fstatfs(fd,buf)

View File

@ -32,7 +32,7 @@
extern "C" int __strtorQ(const char*, char**, int, void*); extern "C" int __strtorQ(const char*, char**, int, void*);
long double strtold(const char* s, char** end_ptr) { long double strtold(const char* s, char** end_ptr) {
#if __LP64__ #if defined(__LP64__)
long double result; long double result;
__strtorQ(s, end_ptr, FLT_ROUNDS, &result); __strtorQ(s, end_ptr, FLT_ROUNDS, &result);
return result; return result;

View File

@ -34,7 +34,7 @@
__BEGIN_DECLS __BEGIN_DECLS
#if __LP64__ #if defined(__LP64__)
#define ElfW(type) Elf64_ ## type #define ElfW(type) Elf64_ ## type
#else #else
#define ElfW(type) Elf32_ ## type #define ElfW(type) Elf32_ ## type

View File

@ -39,7 +39,7 @@ typedef short __int16_t;
typedef unsigned short __uint16_t; typedef unsigned short __uint16_t;
typedef int __int32_t; typedef int __int32_t;
typedef unsigned int __uint32_t; typedef unsigned int __uint32_t;
#if __LP64__ #if defined(__LP64__)
typedef long __int64_t; typedef long __int64_t;
typedef unsigned long __uint64_t; typedef unsigned long __uint64_t;
#else #else
@ -47,7 +47,7 @@ typedef long long __int64_t;
typedef unsigned long long __uint64_t; typedef unsigned long long __uint64_t;
#endif #endif
#if __LP64__ #if defined(__LP64__)
typedef long __intptr_t; typedef long __intptr_t;
typedef unsigned long __uintptr_t; typedef unsigned long __uintptr_t;
#else #else

View File

@ -229,7 +229,7 @@
#include <android/api-level.h> #include <android/api-level.h>
/* glibc compatibility. */ /* glibc compatibility. */
#if __LP64__ #if defined(__LP64__)
#define __WORDSIZE 64 #define __WORDSIZE 64
#else #else
#define __WORDSIZE 32 #define __WORDSIZE 32
@ -278,7 +278,7 @@
#include <android/versioning.h> #include <android/versioning.h>
#if __has_builtin(__builtin_umul_overflow) || __GNUC__ >= 5 #if __has_builtin(__builtin_umul_overflow) || __GNUC__ >= 5
#if __LP64__ #if defined(__LP64__)
#define __size_mul_overflow(a, b, result) __builtin_umull_overflow(a, b, result) #define __size_mul_overflow(a, b, result) __builtin_umull_overflow(a, b, result)
#else #else
#define __size_mul_overflow(a, b, result) __builtin_umul_overflow(a, b, result) #define __size_mul_overflow(a, b, result) __builtin_umul_overflow(a, b, result)

View File

@ -79,7 +79,7 @@ struct ieee_double {
unsigned dbl_sign:1; unsigned dbl_sign:1;
}; };
#if __LP64__ #if defined(__LP64__)
/* 64-bit Android uses ld128 long doubles. */ /* 64-bit Android uses ld128 long doubles. */

View File

@ -16,7 +16,7 @@
#define IEEE_8087 #define IEEE_8087
#if __LP64__ #if defined(__LP64__)
#define Long int #define Long int
#endif #endif

View File

@ -23,7 +23,7 @@
#define d_QNAN0 0x00000000 #define d_QNAN0 0x00000000
#define d_QNAN1 0x7ff80000 #define d_QNAN1 0x7ff80000
#if __LP64__ #if defined(__LP64__)
#define ld_QNAN0 0x00000000 #define ld_QNAN0 0x00000000
#define ld_QNAN1 0x00000000 #define ld_QNAN1 0x00000000
#define ld_QNAN2 0x00000000 #define ld_QNAN2 0x00000000

View File

@ -133,7 +133,7 @@ TEST(libc_logging, ld_LONG_MAX) {
#if defined(__BIONIC__) #if defined(__BIONIC__)
char buf[BUFSIZ]; char buf[BUFSIZ];
__libc_format_buffer(buf, sizeof(buf), "%ld", LONG_MAX); __libc_format_buffer(buf, sizeof(buf), "%ld", LONG_MAX);
#if __LP64__ #if defined(__LP64__)
EXPECT_STREQ("9223372036854775807", buf); EXPECT_STREQ("9223372036854775807", buf);
#else #else
EXPECT_STREQ("2147483647", buf); EXPECT_STREQ("2147483647", buf);
@ -147,7 +147,7 @@ TEST(libc_logging, ld_LONG_MIN) {
#if defined(__BIONIC__) #if defined(__BIONIC__)
char buf[BUFSIZ]; char buf[BUFSIZ];
__libc_format_buffer(buf, sizeof(buf), "%ld", LONG_MIN); __libc_format_buffer(buf, sizeof(buf), "%ld", LONG_MIN);
#if __LP64__ #if defined(__LP64__)
EXPECT_STREQ("-9223372036854775808", buf); EXPECT_STREQ("-9223372036854775808", buf);
#else #else
EXPECT_STREQ("-2147483648", buf); EXPECT_STREQ("-2147483648", buf);

View File

@ -548,7 +548,7 @@ TEST(STDIO_TEST, snprintf_d_INT_MIN) {
TEST(STDIO_TEST, snprintf_ld_LONG_MAX) { TEST(STDIO_TEST, snprintf_ld_LONG_MAX) {
char buf[BUFSIZ]; char buf[BUFSIZ];
snprintf(buf, sizeof(buf), "%ld", LONG_MAX); snprintf(buf, sizeof(buf), "%ld", LONG_MAX);
#if __LP64__ #if defined(__LP64__)
EXPECT_STREQ("9223372036854775807", buf); EXPECT_STREQ("9223372036854775807", buf);
#else #else
EXPECT_STREQ("2147483647", buf); EXPECT_STREQ("2147483647", buf);
@ -558,7 +558,7 @@ TEST(STDIO_TEST, snprintf_ld_LONG_MAX) {
TEST(STDIO_TEST, snprintf_ld_LONG_MIN) { TEST(STDIO_TEST, snprintf_ld_LONG_MIN) {
char buf[BUFSIZ]; char buf[BUFSIZ];
snprintf(buf, sizeof(buf), "%ld", LONG_MIN); snprintf(buf, sizeof(buf), "%ld", LONG_MIN);
#if __LP64__ #if defined(__LP64__)
EXPECT_STREQ("-9223372036854775808", buf); EXPECT_STREQ("-9223372036854775808", buf);
#else #else
EXPECT_STREQ("-2147483648", buf); EXPECT_STREQ("-2147483648", buf);

View File

@ -183,7 +183,7 @@ static void run_watchpoint_test(unsigned cpu) {
run_watchpoint_test_impl<uint8_t>(cpu); run_watchpoint_test_impl<uint8_t>(cpu);
run_watchpoint_test_impl<uint16_t>(cpu); run_watchpoint_test_impl<uint16_t>(cpu);
run_watchpoint_test_impl<uint32_t>(cpu); run_watchpoint_test_impl<uint32_t>(cpu);
#if __LP64__ #if defined(__LP64__)
run_watchpoint_test_impl<uint64_t>(cpu); run_watchpoint_test_impl<uint64_t>(cpu);
#endif #endif
} }