]> thyrsus.com Git - intercal.git/commitdiff
Portability fixes for DOS/Windows
authorAlex Smith <ais523@bham.ac.uk>
Sat, 4 Sep 2010 20:55:28 +0000 (21:55 +0100)
committerAlex Smith <ais523@bham.ac.uk>
Sat, 4 Sep 2010 20:55:28 +0000 (21:55 +0100)
src/abcess.h
src/ick_bool.h
src/oil.y

index 92e0686afc5d0cea4476ace0a8d6276fad98a3fc..e1d0a35b450d649d25522014de96084414cbe8e2 100644 (file)
  * and avoid such grottiness.
  */
 /*@-redef@*/
-#ifdef __STDC_VERSION__
-#if __STDC_VERSION__ >= 199901L
-#include <stdbool.h>
-#endif
-#endif
 #ifndef __bool_true_false_are_defined
+# ifdef HAVE_STDBOOL_H
+#  include <stdbool.h>
+# else
+#  ifndef HAVE__BOOL
+#   ifdef HAVE_STDINT_H
+#    include <stdint.h>
+typedef int_fast8_t bool;
+#   else
 typedef int bool;
-#define true 1
-#define false 0
-#define __bool_true_false_are_defined 1
+#   endif
+#  else
+typedef _Bool bool
+#  endif
+#  define true 1
+#  define false 0
+#  define __bool_true_false_are_defined 1
+# endif
 #endif
 /*@=redef@*/
 
index aae777d6a6995f44f84d9df5dd444553bdb28d88..8430c8d4e65d8861d4027306334a3d00f084959e 100644 (file)
@@ -6,21 +6,23 @@
  */
 
 /*@-redef@ -incondefs*/
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-# ifndef HAVE__BOOL
-#  ifdef HAVE_STDINT_H
-#   include <stdint.h>
+#ifndef __bool_true_false_are_defined
+# ifdef HAVE_STDBOOL_H
+#  include <stdbool.h>
+# else
+#  ifndef HAVE__BOOL
+#   ifdef HAVE_STDINT_H
+#    include <stdint.h>
 typedef int_fast8_t bool;
-#  else
+#   else
 typedef int bool;
-#  endif
-# else
+#   endif
+#  else
 typedef _Bool bool
+#  endif
+#  define true 1
+#  define false 0
+#  define __bool_true_false_are_defined 1
 # endif
-# define true 1
-# define false 0
-# define __bool_true_false_are_defined 1
 #endif
 /*@=redef =incondefs@*/
index db260335889bf4b5d905edece15d82805ec92da3..ff26cb5f1023a1f023ec24ed3c166ce9aa12e768 100644 (file)
--- a/src/oil.y
+++ b/src/oil.y
@@ -735,7 +735,8 @@ void splitend(void)
         "  if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+\n"
         "     x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV);\n");
   printf("  return opted;\n}\n");
-  fclose(stdout);
+  /* do not close stdout; freopen implicitly closes it anyway, and explicitly
+     closing it breaks on DOS */
 }
 
 int main(void)