Better ASSERT macro.
authorBruno Haible <bruno@clisp.org>
Sun, 29 Apr 2007 09:15:13 +0000 (09:15 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 29 Apr 2007 09:15:13 +0000 (09:15 +0000)
82 files changed:
ChangeLog
tests/test-argmatch.c
tests/test-array_list.c
tests/test-array_oset.c
tests/test-avltree_list.c
tests/test-avltree_oset.c
tests/test-avltreehash_list.c
tests/test-binary-io.c
tests/test-byteswap.c
tests/test-c-ctype.c
tests/test-c-strcasecmp.c
tests/test-c-strcasestr.c
tests/test-c-strncasecmp.c
tests/test-c-strstr.c
tests/test-canonicalize-lgpl.c
tests/test-carray_list.c
tests/test-fbufmode.c
tests/test-fprintf-posix.c
tests/test-fpurge.c
tests/test-freadable.c
tests/test-freading.c
tests/test-frexp.c
tests/test-frexpl.c
tests/test-fwritable.c
tests/test-fwriting.c
tests/test-iconv.c
tests/test-isnan.c
tests/test-isnanf.c
tests/test-isnanl.h
tests/test-ldexpl.c
tests/test-linked_list.c
tests/test-linkedhash_list.c
tests/test-mbscasecmp.c
tests/test-mbscasestr1.c
tests/test-mbscasestr2.c
tests/test-mbscasestr3.c
tests/test-mbscasestr4.c
tests/test-mbschr.c
tests/test-mbscspn.c
tests/test-mbsncasecmp.c
tests/test-mbspbrk.c
tests/test-mbspcasecmp.c
tests/test-mbsrchr.c
tests/test-mbsspn.c
tests/test-mbsstr1.c
tests/test-mbsstr2.c
tests/test-mbsstr3.c
tests/test-printf-frexp.c
tests/test-printf-frexpl.c
tests/test-printf-posix.c
tests/test-rbtree_list.c
tests/test-rbtree_oset.c
tests/test-rbtreehash_list.c
tests/test-signbit.c
tests/test-snprintf-posix.c
tests/test-snprintf.c
tests/test-sprintf-posix.c
tests/test-stat-time.c
tests/test-strcasestr.c
tests/test-striconv.c
tests/test-striconveh.c
tests/test-striconveha.c
tests/test-vasnprintf-posix.c
tests/test-vasnprintf-posix2.c
tests/test-vasnprintf.c
tests/test-vasprintf-posix.c
tests/test-vasprintf.c
tests/test-vfprintf-posix.c
tests/test-vprintf-posix.c
tests/test-vsnprintf-posix.c
tests/test-vsnprintf.c
tests/test-vsprintf-posix.c
tests/test-xvasprintf.c
tests/uniconv/test-u16-conv-from-enc.c
tests/uniconv/test-u16-strconv-from-enc.c
tests/uniconv/test-u16-strconv-to-enc.c
tests/uniconv/test-u32-conv-from-enc.c
tests/uniconv/test-u32-strconv-from-enc.c
tests/uniconv/test-u32-strconv-to-enc.c
tests/uniconv/test-u8-conv-from-enc.c
tests/uniconv/test-u8-strconv-from-enc.c
tests/uniconv/test-u8-strconv-to-enc.c

index f819138fd5ea13c1289a60aaf0eefa23085f27a1..1d9ef89cd9cd9d72c828bff68e9980297f811371 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-29  Bruno Haible  <bruno@clisp.org>
+
+       * tests/**/test-*.[hc] (ASSERT): Use fprintf to show the line number.
+       This helps debugging on systems on which no gdb is available.
+
 2007-04-29  Bruno Haible  <bruno@clisp.org>
 
        * lib/freading.h: Improve comments.
index c37fc5dc691b9076fb6037ed422d447ee688a458..e61b88fccef8286e66a4ed84d1a64f7a3dae09fe 100644 (file)
 
 #include "argmatch.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "progname.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 enum backup_type
 {
index b9de7cef0df1c5907cb2e7058dde167c5e9dc76d..1d831f9a3527401c95dc6ba99f047f3602f3f536 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_array_list.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "progname.h"
@@ -32,7 +33,16 @@ static const char *objects[15] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 646e90842a811af7ba789970b7bdfe37f733181c..a7d1f001da7689156d832b8d070442f9879fb695 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_array_oset.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -35,7 +36,16 @@ static const char *objects[30] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index af608cef8ee558c2993464f950cba4797ed15419..8105c8ee4bf817577d1125eb87b276751b1eb2e9 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_avltree_list.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "gl_array_list.h"
@@ -35,7 +36,16 @@ static const char *objects[15] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index c7991359d288ee2f7cf42553f132e6b80ae0e925..e9017745040dcb9254e6966093a673f5d0e34720 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_avltree_oset.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -37,7 +38,16 @@ static const char *objects[30] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index f5ea129901289a14f2ab310cd03d23f856beb40d..65ab49a999ff06ad560aa84ce57352ffab6bf8c2 100644 (file)
@@ -23,6 +23,7 @@
 #include "gl_avltreehash_list.h"
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -62,7 +63,16 @@ string_hash (const void *x)
 }
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 718a66e54f9f1610ca3d341a3d65665dcf447763..677db703ead5bfc7c11a048b4682868f1ddfae03 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 5f9a5a371073948bc06e454b63353cddabbc43e4..97c7c5ebb4542913af2ace5563b6e9b5787ed7cd 100644 (file)
 
 #include <byteswap.h>
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index c8318329a5138bc141f8f2bfb084ea9751431a46..e691ba2e69221d6566f45e6427ce8beeae969df3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include "c-ctype.h"
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static void
 test_all (void)
index 5c153c9afd4719dcd4a7697f20ca4e32a0457495..2fa0f5981d2cfd4e342a567b83dcbadb43f6ef8b 100644 (file)
 #include "c-strcase.h"
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main (int argc, char *argv[])
index a457e5d8c429ef6fcce2d27b2176394f2c4b26ee..427653b54a1f2f6fa4306239f7b3e2c48b34d86f 100644 (file)
 
 #include "c-strcasestr.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 24b00a86e44f47998f32fd3f2da3e3bd6c92b381..76a003e81568ef8065a3f200644817971987c838 100644 (file)
 #include "c-strcase.h"
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main (int argc, char *argv[])
index 98138bab855b494a95a24eea71d3e59b5fe2b078..204e0a5fed766a02768b3217124ad48c013206c4 100644 (file)
 
 #include "c-strstr.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index c5eee8db4d07c782a70e28cc091365d233bb794f..738482b2bcc895a5f5d6acc15ee8270db2fb31fc 100644 (file)
 
 #include "canonicalize.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 4aeece9329bbc0d20a39fcf77a48819e08d79ea6..3234baf3f60ce0fdad1a8a16d95af6afaae2e99b 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_carray_list.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "gl_array_list.h"
@@ -33,7 +34,16 @@ static const char *objects[15] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index cbdf29d7fe433e9f515784ecfb98235666a33554..044d872b36cc49927c64f67691ed5761910c2c85 100644 (file)
 
 #include "fbufmode.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-fbufmode.tmp"
 
index 00402f6db0317b100a667fee71ee9aa2468d08cd..eaf093104dad951429adac46b9099db35ffcccf7 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #include "test-fprintf-posix.h"
 
index b7bac0b6a2ec38f26dbc19c97f534d0d4b020f88..4aadf7f4bf0dee65c6cb0a81adcffd9255bfd90b 100644 (file)
 
 #include "fpurge.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-fpurge.tmp"
 
index 6d15583ca72d63fad4dffb01fc91f1c80382812d..5fb9f3ba291b0afc1a6657a056fe443d6b46b6cd 100644 (file)
 
 #include "freadable.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-freadable.tmp"
 
index b2f6fc7b07c4be60510430efe8cd97fab10ef8c8..1a38b9e44e7b48e1b68bceaefdb7a3302c6ba951 100644 (file)
 
 #include "freading.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-freading.tmp"
 
index 7d2a2758ee09ffa5efd2cd76a2fc13b65e22bd1c..9ce989b06db40540d786b5636ca73c4477abe3e7 100644 (file)
 #include <math.h>
 
 #include <float.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "isnan.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
 #ifdef __DECC
index fd2c7e07926cd52982108cd5523915b13bb82678..93cfa14434f37ae2c0b386ec908c13e896d57ebb 100644 (file)
 #include <math.h>
 
 #include <float.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "fpucw.h"
 #include "isnanl-nolibm.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
    exponent for 'long double' is -964.  For exponents below that, the
index c3b71ecf3bdeca49381e210fe9fc9b7c7b381ca0..29bcee942f645644f1662017a4d94e29ac5802cb 100644 (file)
 
 #include "fwritable.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-fwritable.tmp"
 
index 0f97df5ccf59616ce2d8aff0fc0e0191f1bf2532..a16213046373790b0cdf636d419641f14154cba2 100644 (file)
 
 #include "fwriting.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #define TESTFILE "t-fwriting.tmp"
 
index 00157dad13b4cddaeee2d0536ed66677b9643114..520b96b5a3c702f9dca7c0881753e84ef8212882 100644 (file)
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 0897a55b328e22d7ab36147c708d2de5e5dd48bf..c23b377a22b4e2e6aec89468edafb6011e284247 100644 (file)
 #include "isnan.h"
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
 #ifdef __DECC
index 0fafeade1065ec43619d16675474efadcbaefcba..428c2377299bc093e65ca6cf15ceaf23c56bc08c 100644 (file)
 #include "isnanf.h"
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
 #ifdef __DECC
index 0dab89908ab8a0ffedf1e26967b2764f22702d74..0b3e2f84a35d039ad5dd84f8524e373fa6d87648 100644 (file)
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index c4f35811ab64914d49a3842eaf1105a0fbe98248..97bac54f548ffa79403321f366621efd8799f87c 100644 (file)
 #include <math.h>
 
 #include <float.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "fpucw.h"
 #include "isnanl-nolibm.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 059b2eef6e91c9e6a1a0812cbd9aae1ed650c884..71d96c164e06c4b880d782dc2ae4b18b64b1fb48 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_linked_list.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "gl_array_list.h"
@@ -33,7 +34,16 @@ static const char *objects[15] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 22b67b330e44ff0baf05c23684563ff79f1fcccf..765811ac7fad75a305223f40bb2202fabc8554dc 100644 (file)
@@ -23,6 +23,7 @@
 #include "gl_linkedhash_list.h"
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -60,7 +61,16 @@ string_hash (const void *x)
 }
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 5fd1127147f73c79212398478a743be4c86dba5d..f4d8e859c93b3f7455fa092d0099581299b43b7f 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 87f2605c0f763649264b530391c1979c555defb2..1e658567703ecab67948a1a0c36f83020639d500 100644 (file)
 
 #include <string.h>
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index fc7dca6e84a28df70ba89a5da1a61e07c2d77ec9..548818756b89e4c022901dd9010d733fac68bcd3 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 935e457528c44045c0beef00703a79d3f53e622b..24ace449b132d9329d5c22a53acb74cbcae79eb8 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index ef0c26d4100b3debbb014329183682c6c35628a0..146b3fe5c476da7e6905a6d013b544a5dcfef9ea 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 33f4612738fff0c259e3220d65e92aa1959c9dd6..bf29ee8cbcc6c71d772501bbd7828088d079dc3e 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 62a29e30a5acc0b2c89ac7811d98a10e91265a1e..4403927a7fdb097075dfa512ae640476f306f8e2 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 2a6ffdfda8b7bab6efc2f98bb43ba5f0fc0df1e5..6170dffc663560f4a75376b8f1ba11c9834c57fc 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index fb6be26428731109e4894303ef48fa6b3f95fd94..a6a1404da831fb8ee18ad1f1ac66467941f93db6 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index ad9e575844e7f0163b105971606a590ea9c1b210..5000dfce073e6bb796dde153865ca6f760d5beef 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 58cd6763f2c0c5e4e4882698e116fa59665072ec..35b865c6cb1ec947d34a51318384a59834ae3252 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index cbd4da5a49e9bac10f25c773ead6bca491ad6f7b..3170a6a9417bd774e4254e7a59a01f1ad886e42e 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 549121206e996a3c379eb103202dcbaa173cdf64..d1b079a712f1cd569f3aab1b5c7b8dc90c8c33f2 100644 (file)
 
 #include <string.h>
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 6aebf56af325a88534655a4bd3dc2f0af6d81a68..8ce3be7128beaf63ed318ba7c1580f58a343840c 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 5461196b92c2e64b43ab568aca6e8894d736e09b..9f65520cd679caaf8ff885b8919dae45859ad46b 100644 (file)
 #include <string.h>
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index b821e4613d374309025682af5971ea05b23029b9..6940ceb965adcdd689c616c9caba2d8f6eebc57c 100644 (file)
 #include "printf-frexp.h"
 
 #include <float.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static double
 my_ldexp (double x, int d)
index c57d2f81aeeaedbcc0502d2d11dcf7b44569b699..fe481eec850604bc91b7e16df7421d73bdaaaa2d 100644 (file)
 #include "printf-frexpl.h"
 
 #include <float.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "fpucw.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* On MIPS IRIX machines, LDBL_MIN_EXP is -1021, but the smallest reliable
    exponent for 'long double' is -964.  For exponents below that, the
index d8e728a27b27844d2aa6c1e05d5f05af563b2719..e4d5e874d6c2223f8f685c26b2c0e01f20599f67 100644 (file)
 #include <stdio.h>
 
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #include "test-printf-posix.h"
 
index d6080c05e5e9f0a2d0115d4ea62e1627cc7c3634..c8cd526aae2f1512d9fef871a2baa347d1a15d8c 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_rbtree_list.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "gl_array_list.h"
@@ -35,7 +36,16 @@ static const char *objects[15] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index dd778bb02c02fea3ffed73d4f8a8d2031d9866fc..2ecb81f4a5810690ebf4ab98c66b9eb4a95b8eb5 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "gl_rbtree_oset.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -37,7 +38,16 @@ static const char *objects[30] =
   };
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 7a0cf9665c2eaa11b0e95c06da9203f78a1226c2..deb9cdef58380a698942952e1af005292cbd1917 100644 (file)
@@ -23,6 +23,7 @@
 #include "gl_rbtreehash_list.h"
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -62,7 +63,16 @@ string_hash (const void *x)
 }
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 #define RANDOM(n) (rand () % (n))
 #define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
 
index 3a87c6489da3f8254c0a504acadfd3aaa82bfbbe..63b84eb7dce0b704326250a98e187562f3bcda1e 100644 (file)
 #include <math.h>
 
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 float zerof = 0.0f;
 double zerod = 0.0;
index 3913515e489f57e7afccc5a2545a12b165fd9c41..bbdf3e351cad3d49dea2b1fa41eb39c833c63ab4 100644 (file)
 #include <stdio.h>
 
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #include "test-snprintf-posix.h"
 
index 7b3e9b49e8c78afea67555263cb8deb0c5be68b6..c1235ef03c6e711477c316ae613363c76df77186 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main (int argc, char *argv[])
index bca3b1c6d2b6168cb8d2e467ae79153b6433a1cb..54e7117a7d464c7719f9f744b11bb6b59ae483f0 100644 (file)
 #include <stdio.h>
 
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 #include "test-sprintf-posix.h"
 
index bf3e8dfe361840e918d8911aea9387f50ab8d76b..907ba4b9096cf8d1daca9272db2bf02b41801e1e 100644 (file)
 #include <sys/stat.h>
 #include <unistd.h>
 
-#define ASSERT(condition) if (!(condition)) abort ()
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 enum { NFILES = 4 };
 
index 5ea0f4e792109e481a5ecc6b46e9ba856c107980..3d18c06d37c9510e153242d0d565f77d16ea5e82 100644 (file)
 
 #include <string.h>
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 8fb662c808f2ea6584f07a65f2dc584bf07f0a89..90c2ed38de272a0fd2d67855b31eba9a00d361d7 100644 (file)
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index bb72662eaa18d1f081af4324e3606fc47a992d32..8810dfe3ed8bbafc4b9946bc880151156926f1f6 100644 (file)
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1
index 3d833ac169b93b0aadbe849297fca7f61d992e5f..e3d120cc4238829aa1693ad7ccd6e069e70dc7e5 100644 (file)
 #endif
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1
index a8186558750a5dde3cb405abf55a79d736cf004f..f08e1ad99ff1ce0cee841688e69e35f0e8dcc143 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
 #ifdef __DECC
index eaa95b21141dad798e72b76dfc42d090c81affda..aa68216cda9e713281e1571562d4a54e60dee69e 100644 (file)
 #include "vasnprintf.h"
 
 #include <locale.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main (int argc, char *argv[])
index cd901a9505ffd6a1ec0d6bd916c1e0144b9210ae..80a2543bbb171793ccffd7e08013ebbd46e105a1 100644 (file)
 #include "vasnprintf.h"
 
 #include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static char *
 my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
index dad45d14374b3207ab879dd03443a69ae7ee9cb8..40798ea2bb6bdb9fa574e8f2933811a92a6aac74 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
 #ifdef __DECC
index cae32d6ec4bb440b872940e05aa173888f088897..70fca148ae762d7395beb5096598f6e57e23f86a 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_asprintf (char **result, const char *format, ...)
index 67e50bcf8010c78c97dcf219a2bfca7f81856660..95c3017f64fe21f8cc2184ec60d940a76bff8c2d 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_fprintf (FILE *fp, const char *format, ...)
index 6f7f141d10857ec36e1bc417defe0a2596179207..57b6740161f27bbb7bc4544f5b1c20bc757b6eb4 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_printf (const char *format, ...)
index 052cd72666811804294e4a2417d884289d9234b1..097872f939292dca24a8be437ca3bb13dbd9158b 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_snprintf (char *str, size_t size, const char *format, ...)
index ccc9e5a70364250fcbd92fa8830d00b2490cef82..a8ed6ec7c75523fc8dd24a0b1b3fda0cc9e9cfdd 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_snprintf (char *buf, int size, const char *format, ...)
index 43c7196bf7aa8c8d55676c1524f64d833b57980e..20cc4b2a0f9df1b26ae8017f95d2b6c57673916b 100644 (file)
 
 #include <stdarg.h>
 #include <stddef.h>
+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static int
 my_sprintf (char *str, const char *format, ...)
index a07864c70787e17c4526db2334b29946d5f57903..41e22e47b27cc74230c871e48d37dbae0e513680 100644 (file)
 #include "xvasprintf.h"
 
 #include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "progname.h"
 
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 static char *
 my_xasprintf (const char *format, ...)
index 506af0ec70523ca8d5b4ab9c1d478e3cea36110b..02ce137207c54088c8b9db67da9e300aa987c2d4 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1
index ea805d67b74bd8cf3f987e8f902995b070807ce8..32e482b8d5f12aa7fc0f40989450cfaba277117f 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index c8b9df0aac46a866350b0817cadc800b0eb833e9..35a8eb7b96181d55b922c1728244418645a20154 100644 (file)
 #include "uniconv.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 3226767ba2b0258d8bc65b349f6ceef5555270af..5bf5e14e6c7debecd29cfecb970056858849895d 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1
index ab8b86c147a95738b5b897796a7f75e1ec28617c..b7c02d826e9c294c8647628049b20d06b12bb651 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index 6d65886724cf1bafbb3a5850330cadcec964ccdd..0173370ce0b7ebeefc52d4cc78b7755b7f995b21 100644 (file)
 #include "uniconv.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index e74bc5893db7c898ef5343c86cc3a75fddd7f78f..95cd1003d9e34025eacc32ff25fade763a96577c 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 /* Magic number for detecting bounds violations.  */
 #define MAGIC 0x1983EFF1
index 2d640992e00cc624d71629e6a407d6877a056fe4..2a937cc48581f660ecaee8785e0f38439bc8e290 100644 (file)
 
 #include "uniconv.h"
 
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "unistr.h"
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()
index e03582fb7bacbd595611ebd3d427c63a9f24d5a0..86550f5c22eefe3b6046a472c77cecaebdaf54d8 100644 (file)
 #include "uniconv.h"
 
 #include <errno.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define SIZEOF(array) (sizeof (array) / sizeof (array[0]))
-#define ASSERT(expr) if (!(expr)) abort ();
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
 
 int
 main ()