OSDN Git Service

Move off_t size check from build script to code.
authorrelan <relan@users.noreply.github.com>
Thu, 26 Mar 2015 08:16:24 +0000 (11:16 +0300)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:28:34 +0000 (08:28 +0300)
Make this check independent from a build system.

SConstruct
libexfat/exfat.h

index 6fadd8c..9715edf 100644 (file)
@@ -88,13 +88,6 @@ if not env.GetOption('clean'):
 '''
                Exit(1)
 
-       if not conf.CheckTypeSize('off_t', '#include <sys/types.h>', '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()
 
 
index 2a881e4..6d9bcf1 100644 (file)
 #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;