libbb.h: add check for bad off_t size detection

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-11-17 21:51:32 +01:00
parent f59a50ee30
commit 1dc80bae0b

View File

@ -245,6 +245,12 @@ typedef unsigned long uoff_t;
#endif #endif
/* scary. better ideas? (but do *test* them first!) */ /* scary. better ideas? (but do *test* them first!) */
#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) #define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1)))
/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested.
* We misdetected that. Don't let it build:
*/
struct BUG_off_t_size_is_misdetected {
char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1];
};
/* Some useful definitions */ /* Some useful definitions */
#undef FALSE #undef FALSE