summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-08-29 07:42:08 +0000
committerJakub Jelinek <jakub@redhat.com>2008-08-29 07:42:08 +0000
commit315a43aa949b25896c511fa6e2efd6be57e2e01d (patch)
tree625aa5d40df04b92dcd3bd8128d30e52a45975ac /scripts
parent2fb513c60061821c7e5e7fb6014d2afd0308b7e9 (diff)
Updated to fedora-glibc-20080828T1623cvs/fedora-glibc-2_8_90-12
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen-as-const.awk14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/gen-as-const.awk b/scripts/gen-as-const.awk
index 23f2f2bc9b..20d18c12af 100644
--- a/scripts/gen-as-const.awk
+++ b/scripts/gen-as-const.awk
@@ -16,12 +16,20 @@ NF >= 1 && !started {
if (test) {
print "\n#include <inttypes.h>";
print "\n#include <stdio.h>";
+ print "\n#if __WORDSIZE__ == 64";
+ print "\ntypedef uint64_t c_t;";
print "\n#define U(n) UINT64_C (n)";
+ print "\n#define PRI PRId64";
+ print "\n#else";
+ print "\ntypedef uint32_t c_t;";
+ print "\n#define U(n) UINT32_C (n)";
+ print "\n#define PRI PRId32";
+ print "\n#endif";
print "\nstatic int do_test (void)\n{\n int bad = 0, good = 0;\n";
print "#define TEST(name, source, expr) \\\n" \
- " if (U (asconst_##name) != (uint64_t) (expr)) { ++bad;" \
- " fprintf (stderr, \"%s: %s is %\" PRId64 \" but %s is %\"PRId64 \"\\n\"," \
- " source, #name, U (asconst_##name), #expr, (uint64_t) (expr));" \
+ " if (U (asconst_##name) != (c_t) (expr)) { ++bad;" \
+ " fprintf (stderr, \"%s: %s is %\" PRI \" but %s is %\"PRI \"\\n\"," \
+ " source, #name, U (asconst_##name), #expr, (c_t) (expr));" \
" } else ++good;\n";
}
else