From: relan Date: Thu, 26 Mar 2015 08:16:24 +0000 (+0300) Subject: Move off_t size check from build script to code. X-Git-Tag: android-x86-6.0-r1~37 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4b2d73e1b017f629d0c55f917671dc8bd6333841;p=android-x86%2Fexternal-exfat.git Move off_t size check from build script to code. Make this check independent from a build system. --- diff --git a/SConstruct b/SConstruct index 6fadd8c..9715edf 100644 --- a/SConstruct +++ b/SConstruct @@ -88,13 +88,6 @@ if not env.GetOption('clean'): ''' Exit(1) - if not conf.CheckTypeSize('off_t', '#include ', 'C', 8): - print ''' - The size of off_t type must be 64 bits. File systems larger than - 2 GB will be corrupted with 32-bit off_t. -''' - Exit(1) - env = conf.Finish() diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 2a881e4..6d9bcf1 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -61,6 +61,10 @@ #define BMAP_CLR(bitmap, index) \ ((bitmap)[BMAP_BLOCK(index)] &= ~BMAP_MASK(index)) +/* The size of off_t type must be 64 bits. File systems larger than 2 GB will + be corrupted with 32-bit off_t. */ +STATIC_ASSERT(sizeof(off_t) == 8); + struct exfat_node { struct exfat_node* parent;