utils/t/exc-test.c: Print null pointers in a consistent way.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 14 May 2016 18:31:11 +0000 (19:31 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 May 2016 00:32:29 +0000 (01:32 +0100)
Cygwin prints `0x0' instead of `(nil)'.  Fortunately, this is the only
pointer value we can reliably check for, so handle this ourselves.

utils/t/exc-test.c

index ba74b94..89701bf 100644 (file)
@@ -35,7 +35,10 @@ int main(void)
       printf("%lu exception (val = %i)\n", exc_type, exc_i);
       break;
   } END_TRY;
-  printf("hello! __exc_list = %p\n", (void *)__exc_list);
+  printf("hello! __exc_list = ");
+  if (__exc_list) printf("%p", (void *)__exc_list);
+  else printf("(nil)");
+  putchar('\n');
 
   return (0);
 }