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 f819138..1d9ef89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
        * lib/fwriting.h: Likewise.
        * tests/test-freading.c (main): Don't check freading immediately after
index c37fc5d..e61b88f 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 b9de7ce..1d831f9 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 646e908..a7d1f00 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 af608ce..8105c8e 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 c799135..e901774 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 f5ea129..65ab49a 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 718a66e..677db70 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 5f9a5a3..97c7c5e 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 c831832..e691ba2 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 5c153c9..2fa0f59 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 a457e5d..427653b 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 24b00a8..76a003e 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 98138ba..204e0a5 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 c5eee8d..738482b 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 4aeece9..3234baf 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 cbdf29d..044d872 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 00402f6..eaf0931 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 b7bac0b..4aadf7f 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 6d15583..5fb9f3b 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 b2f6fc7..1a38b9e 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 7d2a275..9ce989b 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 fd2c7e0..93cfa14 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 c3b71ec..29bcee9 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 0f97df5..a162130 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 00157da..520b96b 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 0897a55..c23b377 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 0fafead..428c237 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 0dab899..0b3e2f8 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 c4f3581..97bac54 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 059b2ee..71d96c1 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 22b67b3..765811a 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 5fd1127..f4d8e85 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 87f2605..1e65856 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 fc7dca6..5488187 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 935e457..24ace44 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 ef0c26d..146b3fe 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 33f4612..bf29ee8 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 62a29e3..4403927 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 2a6ffdf..6170dff 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 fb6be26..a6a1404 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 ad9e575..5000dfc 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 58cd676..35b865c 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 cbd4da5..3170a6a 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 5491212..d1b079a 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 6aebf56..8ce3be7 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 5461196..9f65520 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 b821e46..6940ceb 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 c57d2f8..fe481ee 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 d8e728a..e4d5e87 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 d6080c0..c8cd526 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 dd778bb..2ecb81f 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 7a0cf96..deb9cde 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 3a87c64..63b84eb 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 3913515..bbdf3e3 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 7b3e9b4..c1235ef 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 bca3b1c..54e7117 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 bf3e8df..907ba4b 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 5ea0f4e..3d18c06 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 8fb662c..90c2ed3 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 bb72662..8810dfe 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 3d833ac..e3d120c 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 a818655..f08e1ad 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 eaa95b2..aa68216 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 cd901a9..80a2543 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 dad45d1..40798ea 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 cae32d6..70fca14 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 67e50bc..95c3017 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 6f7f141..57b6740 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 052cd72..097872f 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 ccc9e5a..a8ed6ec 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 43c7196..20cc4b2 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 a07864c..41e22e4 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 506af0e..02ce137 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 ea805d6..32e482b 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 c8b9df0..35a8eb7 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 3226767..5bf5e14 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 ab8b86c..b7c02d8 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 6d65886..0173370 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 e74bc58..95cd100 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 2d64099..2a937cc 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 e03582f..86550f5 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 ()