shithub: MicroHs

Download patch

ref: 99032d3f7b2f5e369c76f99eb4bbfdeb69171509
parent: 20336858f19b2ce0297b5c51adacf097340206ea
author: Rewbert <krookr@chalmers.se>
date: Mon Dec 18 10:14:15 EST 2023

exit -> EXIT, and spellcorrection of exit->EXIT

--- a/src/runtime/config-micro-64.h
+++ b/src/runtime/config-micro-64.h
@@ -68,9 +68,14 @@
 #define MALLOC malloc
 
 /*
- * Free heap memory, void free(void *p)
+ * Free heap memory, void FREE(void *p)
  */
 #define FREE free
+
+/*
+ * exit execution, void EXIT(int code)
+ */
+#define EXIT exit
 
 #define GCRED    0              /* do some reductions during GC */
 #define FASTTAGS 1              /* compute tag by pointer subtraction */
--- a/src/runtime/config-mingw-64.h
+++ b/src/runtime/config-mingw-64.h
@@ -52,9 +52,14 @@
 #define MALLOC malloc
 
 /*
- * Free heap memory, void free(void *p)
+ * Free heap memory, void FREE(void *p)
  */
 #define FREE free
+
+/*
+ * exit execution, void EXIT(int code)
+ */
+#define EXIT exit
 
 #define GCRED    1              /* do some reductions during GC */
 #define FASTTAGS 1              /* compute tag by pointer subtraction */
--- a/src/runtime/config-unix-64.h
+++ b/src/runtime/config-unix-64.h
@@ -175,9 +175,14 @@
 #define MALLOC malloc
 
 /*
- * Free heap memory, void free(void *p)
+ * Free heap memory, void FREE(void *p)
  */
 #define FREE free
+
+/*
+ * exit execution, void EXIT(int code)
+ */
+#define EXIT exit
 
 #define GCRED    1              /* do some reductions during GC */
 #define FASTTAGS 1              /* compute tag by pointer subtraction */
--- a/src/runtime/config-windows-64.h
+++ b/src/runtime/config-windows-64.h
@@ -112,9 +112,14 @@
 #define MALLOC malloc
 
 /*
- * Free heap memory, void free(void *p)
+ * Free heap memory, void FREE(void *p)
  */
 #define FREE free
+
+/*
+ * exit execution, void EXIT(int code)
+ */
+#define EXIT exit
 
 #define GCRED    1              /* do some reductions during GC */
 #define FASTTAGS 1              /* compute tag by pointer subtraction */
--- a/src/runtime/eval.c
+++ b/src/runtime/eval.c
@@ -96,11 +96,11 @@
 
 #if !defined(ERR)
 #if WANT_STDIO
-#define ERR(s)    do { fprintf(stderr,"ERR: "s"\n");   exit(1); } while(0)
-#define ERR1(s,a) do { fprintf(stderr,"ERR: "s"\n",a); exit(1); } while(0)
+#define ERR(s)    do { fprintf(stderr,"ERR: "s"\n");   EXIT(1); } while(0)
+#define ERR1(s,a) do { fprintf(stderr,"ERR: "s"\n",a); EXIT(1); } while(0)
 #else  /* WANT_STDIO */
-#define ERR(s) exit(1)
-#define ERR1(s,a) exit(1)
+#define ERR(s) EXIT(1)
+#define ERR1(s,a) EXIT(1)
 #endif  /* WANT_STDIO */
 #endif  /* !define(ERR) */
 
@@ -243,7 +243,7 @@
 memerr(void)
 {
   ERR("Out of memory");
-  exit(1);
+  EXIT(1);
 }
 
 struct ioarray*
@@ -2221,7 +2221,7 @@
         CHKARGEV1(msg = evalstring(x, 0));
 #if WANT_STDIO
         fprintf(stderr, "mhs: %s\n", msg);
-        exit(1);
+        EXIT(1);
 #else  /* WANT_STDIO */
         ERR1("error: %s", msg);
 #endif  /* WANT_STDIO */
@@ -2660,7 +2660,7 @@
       ERR1("cannot open output file %s", outname);
     print(out, prog, 1);
     fclose(out);
-    exit(0);
+    EXIT(0);
   }
   if (verbose > 2) {
     //pp(stdout, prog);
@@ -2700,7 +2700,7 @@
 #endif
   }
 #endif  /* WANT_STDIO */
-  exit(0);
+  EXIT(0);
 }
 
 #if WANT_MD5
--