[MLton-commit] r5514

Matthew Fluet fluet at mlton.org
Wed Apr 11 13:46:48 PDT 2007


Use C99 <assert.h>
----------------------------------------------------------------------

U   mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
D   mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.c
D   mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.h
U   mlton/branches/on-20050822-x86_64-branch/runtime/util.c
U   mlton/branches/on-20050822-x86_64-branch/runtime/util.h

----------------------------------------------------------------------

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h	2007-04-11 20:43:46 UTC (rev 5513)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/cenv.h	2007-04-11 20:46:47 UTC (rev 5514)
@@ -21,8 +21,13 @@
 #endif
 #define _FILE_OFFSET_BITS 64
 
+#ifndef ASSERT
+#define ASSERT 0
+#define NDEBUG
+#endif
+
 /* C99 headers */
-// #include <assert.h>
+#include <assert.h>
 // #include <complex.h>
 #include <ctype.h>
 #include <errno.h>

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.c	2007-04-11 20:43:46 UTC (rev 5513)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.c	2007-04-11 20:46:47 UTC (rev 5514)
@@ -1,17 +0,0 @@
-/* Copyright (C) 2004-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-#include "util.h"
-
-void asok (void) {
-}
-
-void asfail(const char *file, int line, const char *prop) {
-  fflush(stdout);
-  fprintf(stderr, "%s:%d: assert(%s) failed.\n", file, line, prop);
-  abort();
-}

Deleted: mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.h	2007-04-11 20:43:46 UTC (rev 5513)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util/assert.h	2007-04-11 20:46:47 UTC (rev 5514)
@@ -1,23 +0,0 @@
-/* Copyright (C) 2004-2005 Henry Cejtin, Matthew Fluet, Suresh
- *    Jagannathan, and Stephen Weeks.
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- */
-
-#ifndef ASSERT
-#define ASSERT 0
-#endif
-
-/* Assertion failure routine */
-extern void asfail (const char *file, int line, const char *prop)
-                        __attribute__ ((noreturn));
-
-extern void asok (void);
-
-/* Assertion verifier */
-#if ASSERT
-#define assert(p) ((p) ? asok() : asfail(__FILE__, __LINE__, #p))
-#else
-#define assert(p) ((void)0)
-#endif

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util.c
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util.c	2007-04-11 20:43:46 UTC (rev 5513)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util.c	2007-04-11 20:46:47 UTC (rev 5514)
@@ -5,6 +5,5 @@
  * See the file MLton-LICENSE for details.
  */
 
-#include "util/assert.c"
 #include "util/die.c"
 #include "util/to-string.c"

Modified: mlton/branches/on-20050822-x86_64-branch/runtime/util.h
===================================================================
--- mlton/branches/on-20050822-x86_64-branch/runtime/util.h	2007-04-11 20:43:46 UTC (rev 5513)
+++ mlton/branches/on-20050822-x86_64-branch/runtime/util.h	2007-04-11 20:46:47 UTC (rev 5514)
@@ -33,7 +33,6 @@
 #define min(a, b) ((a)<(b)?(a):(b))
 #endif
 
-#include "util/assert.h"
 #include "util/die.h"
 #include "util/safe.h"
 #include "util/read_write.h"




More information about the MLton-commit mailing list