From: Rusty Russell Date: Tue, 19 Apr 2011 07:23:39 +0000 (+0930) Subject: configurator: HAVE_FILE_OFFSET_BITS X-Git-Url: https://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=4db6a6709bb3426466317c04c618bcb8034bb5b5;hp=1c6f12a3c7f65e6130335a43e799dc3aa6a23a18 configurator: HAVE_FILE_OFFSET_BITS Defines whether it's useful to do #define _FILE_OFFSET_BITS 64 to get a larger off_t. --- diff --git a/config.h b/config.h index 3b5823ce..dbfe0295 100644 --- 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 diff --git a/tools/configurator/configurator.c b/tools/configurator/configurator.c index 3d2b16f5..7b9652be 100644 --- a/tools/configurator/configurator.c +++ b/tools/configurator/configurator.c @@ -38,6 +38,11 @@ struct test { }; static struct test tests[] = { + { "HAVE_32BIT_OFF_T", DEFINES_EVERYTHING|EXECUTE, NULL, + "#include \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 \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;" },