configurator: HAVE_FILE_OFFSET_BITS
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 19 Apr 2011 07:23:39 +0000 (16:53 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 19 Apr 2011 07:23:39 +0000 (16:53 +0930)
Defines whether it's useful to do #define _FILE_OFFSET_BITS 64 to get a
larger off_t.

config.h
tools/configurator/configurator.c

index 3b5823ceeabc5eaa2082a2d508d304eeaaa99a0e..dbfe0295fdf4c32c49ae672108c2905a0af373ce 100644 (file)
--- a/config.h
+++ b/config.h
@@ -5,6 +5,7 @@
 #define CCAN_COMPILER "cc"
 #define CCAN_CFLAGS "-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wwrite-strings -DCCAN_STR_DEBUG=1"
 
+#define HAVE_32BIT_OFF_T 1
 #define HAVE_ALIGNOF 1
 #define HAVE_ASPRINTF 1
 #define HAVE_ATTRIBUTE_COLD 1
@@ -28,6 +29,7 @@
 #define HAVE_BUILTIN_TYPES_COMPATIBLE_P 1
 #define HAVE_BYTESWAP_H 1
 #define HAVE_COMPOUND_LITERALS 1
+#define HAVE_FILE_OFFSET_BITS 1
 #define HAVE_FOR_LOOP_DECLARATION 0
 #define HAVE_FLEXIBLE_ARRAY_MEMBER 1
 #define HAVE_GETPAGESIZE 1
index 3d2b16f5938eb6dca042778439b8c94ef77d6f4d..7b9652be90ef096045ce1545f84b9c1afa5b05ec 100644 (file)
@@ -38,6 +38,11 @@ struct test {
 };
 
 static struct test tests[] = {
+       { "HAVE_32BIT_OFF_T", DEFINES_EVERYTHING|EXECUTE, NULL,
+         "#include <sys/types.h>\n"
+         "int main(int argc, char *argv[]) {\n"
+         "     return sizeof(off_t) == 4 ? 0 : 1;\n"
+         "}\n" },
        { "HAVE_ALIGNOF", INSIDE_MAIN, NULL,
          "return __alignof__(double) > 0 ? 0 : 1;" },
        { "HAVE_ASPRINTF", DEFINES_FUNC, NULL,
@@ -95,6 +100,13 @@ static struct test tests[] = {
        { "HAVE_COMPOUND_LITERALS", INSIDE_MAIN, NULL,
          "int *foo = (int[]) { 1, 2, 3, 4 };\n"
          "return foo[0] ? 0 : 1;" },
+       { "HAVE_FILE_OFFSET_BITS", DEFINES_EVERYTHING|EXECUTE,
+         "HAVE_32BIT_OFF_T",
+         "#define _FILE_OFFSET_BITS 64\n"
+         "#include <sys/types.h>\n"
+         "int main(int argc, char *argv[]) {\n"
+         "     return sizeof(off_t) == 8 ? 0 : 1;\n"
+         "}\n" },
        { "HAVE_FOR_LOOP_DECLARATION", INSIDE_MAIN, NULL,
          "for (int i = 0; i < argc; i++) { return 0; };\n"
          "return 1;" },