summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-04-02 20:22:00 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-04-02 20:24:15 +0100
commit74d8288d7a8fa83989968647149ae47ba10194f8 (patch)
tree10d034377aeb12b9a690057ef32dbffac41b8bdc
parent576bd90c75d47d64d8cd36b580d18958baceecd7 (diff)
Fix build on systems where size_t is (non-long) uintexim-4_87
The exemplar was Ubuntu 14.04 LTS 32-bit - but probably many 32-bit systems would be affected
-rw-r--r--src/src/buildconfig.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/src/buildconfig.c b/src/src/buildconfig.c
index 4c1a72d51..27e73142f 100644
--- a/src/src/buildconfig.c
+++ b/src/src/buildconfig.c
@@ -105,8 +105,10 @@ time_t test_time_t = 0;
size_t test_size_t = 0;
ssize_t test_ssize_t = 0;
unsigned long test_ulong_t = 0L;
+unsigned int test_uint_t = 0;
#endif
long test_long_t = 0;
+int test_int_t = 0;
FILE *base;
FILE *new;
int last_initial = 'A';
@@ -190,12 +192,17 @@ fprintf(new, "#define SSIZE_T_FMT \"%%zd\"\n");
#else
if (sizeof(test_size_t) > sizeof (test_ulong_t))
fprintf(new, "#define SIZE_T_FMT \"%%llu\"\n");
-else
+else if (sizeof(test_size_t) > sizeof (test_uint_t))
fprintf(new, "#define SIZE_T_FMT \"%%lu\"\n");
+else
+ fprintf(new, "#define SIZE_T_FMT \"%%u\"\n");
+
if (sizeof(test_ssize_t) > sizeof(test_long_t))
fprintf(new, "#define SSIZE_T_FMT \"%%lld\"\n");
-else
+else if (sizeof(test_ssize_t) > sizeof(test_int_t))
fprintf(new, "#define SSIZE_T_FMT \"%%ld\"\n");
+else
+ fprintf(new, "#define SSIZE_T_FMT \"%%d\"\n");
#endif
/* Now search the makefile for certain settings */