Small fix to make compilation C99 compliant.
authorShamus Hammons <jlhamm@acm.org>
Tue, 13 Sep 2016 00:16:03 +0000 (19:16 -0500)
committerShamus Hammons <jlhamm@acm.org>
Tue, 13 Sep 2016 00:16:03 +0000 (19:16 -0500)
This probably won't help on Visual Studio, unless you can tell the build
system there to use a C99 compliant compiler (MS's track record in this
area is abysmal).

makefile
rmac.h
version.h

index 33b9cfe43d5e4227b39f1779b50031ed5a310efc..cd52ffe9bc983b00ec0018d1be59cb0a7567b3ae 100644 (file)
--- a/makefile
+++ b/makefile
@@ -8,7 +8,7 @@ rm = /bin/rm -f
 CC = $(CROSS)gcc
 HOSTCC = gcc
 
-CFLAGS = -g -D__GCCUNIX__ -I. -O2
+CFLAGS = -std=c99 -g -D__GCCUNIX__ -I. -O2
 
 SRCS = amode.c debug.c direct.c eagen.c error.c expr.c listing.c mach.c macro.c mark.c object.c procln.c riscasm.c rmac.c sect.c symbol.c token.c 
 
diff --git a/rmac.h b/rmac.h
index f7b39e39b8d027ded9bf9b68da12dcd408fd7aa4..337096d1ae61d1fafa8922c1ff5c445b951c459c 100644 (file)
--- a/rmac.h
+++ b/rmac.h
@@ -9,10 +9,19 @@
 #ifndef __RMAC_H__
 #define __RMAC_H__
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
 //
 // TARGET SPECIFIC BUILD SETTINGS
 //
 #if defined(WIN32) || defined (WIN64)
+       #include <io.h>
+       #include <fcntl.h>
        // Release platform - windows
        #define PLATFORM        "Win32"
        #define _OPEN_FLAGS     _O_TRUNC|_O_CREAT|_O_BINARY|_O_RDWR
        #define WARNING(desc) DO_PRAGMA(message (#desc))
 
        #endif
-       #include <io.h>
-       #include <fcntl.h>
-       #include <stdio.h>
-       #include <stdlib.h>
-       #include <string.h>
-       #include <ctype.h>
-       #include <sys/types.h>
-       #include <sys/stat.h>
 
 #else 
        #ifdef __GCCUNIX__
+       #include <sys/fcntl.h>
+       #include <unistd.h>
        // Release platform - mac OS-X or linux
        #define PLATFORM        "OSX/Linux"
        #define _OPEN_FLAGS     O_TRUNC|O_CREAT|O_RDWR
        #define _OPEN_INC       O_RDONLY
-       #define _PERM_MODE      S_IREAD|S_IWRITE 
+       #define _PERM_MODE      S_IRUSR|S_IWUSR
        // WARNING WARNING WARNING
        #define DO_PRAGMA(x) _Pragma (#x)
        #define WARNING(desc) DO_PRAGMA(message (#desc))
-       #include <sys/fcntl.h>
-       #include <stdio.h>
-       #include <stdlib.h>
-       #include <string.h>
-       #include <ctype.h>
-       #include <sys/types.h>
-       #include <sys/stat.h>
-       #include <unistd.h>
 #else
        // Release platform - not specified 
+       #include <sys/fcntl.h>
        #define PLATFORM        "Unknown"
        #define _OPEN_FLAGS     O_TRUNC|O_CREAT|O_RDWR
        #define _OPEN_INC       O_RDONLY
-       #define _PERM_MODE      S_IREAD|S_IWRITE 
-       // Defined here, even though the platfrom may not support it...
+       #define _PERM_MODE      S_IREAD|S_IWRITE
+       // Defined here, even though the platform may not support it...
        #define DO_PRAGMA(x) _Pragma (#x)
        #define WARNING(desc) DO_PRAGMA(message (#desc))
-       #include <sys/fcntl.h>
-       #include <stdio.h>
-       #include <stdlib.h>
-       #include <string.h>
-       #include <ctype.h>
-       #include <sys/types.h>
-       #include <sys/stat.h>
        #endif
 #endif
 
index b95358f85a41dca0a769766611662382319c0c45..b4f423c29bf8d65c85484ac45d6a01c1cca3555d 100644 (file)
--- a/version.h
+++ b/version.h
@@ -13,6 +13,6 @@
 
 #define MAJOR   1              // Major version number
 #define MINOR   4              // Minor version number
-#define PATCH   12             // Patch release number
+#define PATCH   13             // Patch release number
 
 #endif // __VERSION_H__