Fixed large file issue on 32-bit platforms
authorErik Lindahl <erik@kth.se>
Tue, 10 May 2016 22:19:49 +0000 (00:19 +0200)
committerErik Lindahl <erik@kth.se>
Tue, 10 May 2016 22:21:37 +0000 (00:21 +0200)
At some point gcc started to issue a warning
instead of a fatal error for the checking
code; fixed to really generate an error now.

Fixes #1834.

Change-Id: I5827f358b22de516becaac02d81229b82b02297b

cmake/TestFileOffsetBits.c

index df671cf73fd598acd992426aa08de055899bac40..e7efc0e6342a4b3af28a6f821b5309281eb9788b 100644 (file)
@@ -3,8 +3,7 @@
 int main()
 {
   /* Cause a compile-time error if off_t is smaller than 64 bits */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];  
+  int off_t_is_large[sizeof(off_t)-7];
   return off_t_is_large[0];
 }