[trunk] Properly copy/paste code from the autotools
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 27 Mar 2014 15:07:58 +0000 (15:07 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Thu, 27 Mar 2014 15:07:58 +0000 (15:07 +0000)
gcc correctly fails compiling this code, I needed to move the code outside the main function to get the error. This actually match the autotools (incorrect) code. We'll see how they fix this code in future release.
This make the code compatible with previous openjpeg version and remove C99 requirement.
Fixes issue 316

cmake/TestFileOffsetBits.c

index 7cf93b719a53b805adbac59a9952b406c400d3a5..cd679c1130cd0d3733fa6d16fb5006541990f7bd 100644 (file)
@@ -1,10 +1,11 @@
 #include <sys/types.h>
 
+/* 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 main(int argc, char **argv)
 {
-  /* Cause a compile-time error if off_t is smaller than 64 bits */
-#define LARGE_OFF_T (((off_t) (1LL << 62)) - 1 + ((off_t) (1LL << 62)))
-  int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];  
   return 0;
 }