From db5a5ada90e46cf844651601d9f21089ca6934f9 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 9 Oct 2012 20:25:32 +0200 Subject: [PATCH] ndk: Remove LONG_LONG_MIN/MAX hack from pthread.h The LONG_LONG_MIN, LONG_LONG_MAX and ULONG_LONG_MAX are GLibc-specific macros. Move their declarations from to where they belong. Change-Id: I597465b99893706ade82069238f60df73d8e236e --- ndk/platforms/android-3/include/limits.h | 16 ++++++++++++++++ ndk/platforms/android-3/include/pthread.h | 5 ----- ndk/platforms/android-5/include/pthread.h | 5 ----- ndk/platforms/android-8/include/pthread.h | 5 ----- ndk/platforms/android-9/include/pthread.h | 5 ----- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/ndk/platforms/android-3/include/limits.h b/ndk/platforms/android-3/include/limits.h index 1de8ea611..0bde5a2d9 100644 --- a/ndk/platforms/android-3/include/limits.h +++ b/ndk/platforms/android-3/include/limits.h @@ -89,6 +89,22 @@ #include #endif +/* GLibc compatibility definitions. + Note that these are defined by GCC's + only when __GNU_LIBRARY__ is defined, i.e. when + targetting GLibc. */ +#ifndef LONG_LONG_MIN +#define LONG_LONG_MIN LLONG_MIN +#endif + +#ifndef LONG_LONG_MAX +#define LONG_LONG_MAX LLONG_MAX +#endif + +#ifndef ULONG_LONG_MAX +#define ULONG_LONG_MAX ULLONG_MAX +#endif + #ifndef PAGESIZE #define PAGESIZE PAGE_SIZE #endif diff --git a/ndk/platforms/android-3/include/pthread.h b/ndk/platforms/android-3/include/pthread.h index 2a6029d64..ae55782f1 100644 --- a/ndk/platforms/android-3/include/pthread.h +++ b/ndk/platforms/android-3/include/pthread.h @@ -235,9 +235,4 @@ extern void __pthread_cleanup_pop(__pthread_cleanup_t* c, } /* extern "C" */ #endif -/************ TO FIX ************/ - -#define LONG_LONG_MAX __LONG_LONG_MAX__ -#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1) - #endif /* _PTHREAD_H_ */ diff --git a/ndk/platforms/android-5/include/pthread.h b/ndk/platforms/android-5/include/pthread.h index a20a52de1..ba40fa1af 100644 --- a/ndk/platforms/android-5/include/pthread.h +++ b/ndk/platforms/android-5/include/pthread.h @@ -262,9 +262,4 @@ extern void __pthread_cleanup_pop(__pthread_cleanup_t* c, } /* extern "C" */ #endif -/************ TO FIX ************/ - -#define LONG_LONG_MAX __LONG_LONG_MAX__ -#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1) - #endif /* _PTHREAD_H_ */ diff --git a/ndk/platforms/android-8/include/pthread.h b/ndk/platforms/android-8/include/pthread.h index f7a596acb..7741fcf23 100644 --- a/ndk/platforms/android-8/include/pthread.h +++ b/ndk/platforms/android-8/include/pthread.h @@ -267,9 +267,4 @@ extern void __pthread_cleanup_pop(__pthread_cleanup_t* c, } /* extern "C" */ #endif -/************ TO FIX ************/ - -#define LONG_LONG_MAX __LONG_LONG_MAX__ -#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1) - #endif /* _PTHREAD_H_ */ diff --git a/ndk/platforms/android-9/include/pthread.h b/ndk/platforms/android-9/include/pthread.h index 4baf82f75..4cfc9b01f 100644 --- a/ndk/platforms/android-9/include/pthread.h +++ b/ndk/platforms/android-9/include/pthread.h @@ -306,9 +306,4 @@ extern void __pthread_cleanup_pop(__pthread_cleanup_t* c, } /* extern "C" */ #endif -/************ TO FIX ************/ - -#define LONG_LONG_MAX __LONG_LONG_MAX__ -#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1) - #endif /* _PTHREAD_H_ */