]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* scripts/gen-as-const.awk: Use 32-bit values on 32-bit platforms.
authorUlrich Drepper <drepper@redhat.com>
Wed, 6 Aug 2008 02:09:47 +0000 (02:09 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 6 Aug 2008 02:09:47 +0000 (02:09 +0000)
ChangeLog
scripts/gen-as-const.awk

index d379de51388da997a61b5824c652bc8cc884ba37..c94308ff801b9355001d3b952633ca6510016b26 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2008-08-05  Ulrich Drepper  <drepper@redhat.com>
 
+       * scripts/gen-as-const.awk: Use 32-bit values on 32-bit platforms.
+
        [BZ #5794]
        * sysdeps/i386/fpu/s_expm1l.S: Simply use exp implementation for large
        parameters.
index 23f2f2bc9bd23dbbbf44243607f32de45b19fbcc..20d18c12afcabd050005b06322aa01f676db37fc 100644 (file)
@@ -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