]> Shamusworld >> Repos - rmac/blobdiff - rmac.h
Extended switch -s to also warn about automatically applied 68000 optimisations....
[rmac] / rmac.h
diff --git a/rmac.h b/rmac.h
index 5ef9953c1559fe83ce93f14bc0f7cb0bfad39f90..f7b39e39b8d027ded9bf9b68da12dcd408fd7aa4 100644 (file)
--- a/rmac.h
+++ b/rmac.h
                        #pragma warning(disable:4996)
                #endif
 
-       //Makes warnings double clickable on visual studio
+       // Makes warnings double clickable on visual studio (ggn)
        #define STRINGIZE_HELPER(x) #x
        #define STRINGIZE(x) STRINGIZE_HELPER(x)
-       #define WARNING(desc) message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc)
+       #define WARNING(desc) __pragma(message(__FILE__ "(" STRINGIZE(__LINE__) ") : Warning: " #desc))
 
        // usage:
-       //#pragma WARNING(FIXME: Code removed because...)
+       // WARNING(FIXME: Code removed because...)
+
+       #else
+       //If we're not compiling for Visual Studio let's assume that we're using
+       //some flavour of gcc instead. So let's use the gcc compliant macro instead.
+       //If some weirdo uses something else (I dunno, Intel compiler or something?)
+       //this is probably going to explode spectacularly. Let's wait for the fireworks!
+       #define DO_PRAGMA(x) _Pragma (#x)
+       #define WARNING(desc) DO_PRAGMA(message (#desc))
 
        #endif
        #include <io.h>
@@ -48,6 +56,9 @@
        #define _OPEN_FLAGS     O_TRUNC|O_CREAT|O_RDWR
        #define _OPEN_INC       O_RDONLY
        #define _PERM_MODE      S_IREAD|S_IWRITE 
+       // 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>
@@ -62,6 +73,9 @@
        #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 DO_PRAGMA(x) _Pragma (#x)
+       #define WARNING(desc) DO_PRAGMA(message (#desc))
        #include <sys/fcntl.h>
        #include <stdio.h>
        #include <stdlib.h>
@@ -196,6 +210,8 @@ extern int lsym_flag;
 extern int sbra_flag;
 extern int obj_format;
 extern int legacy_flag;
+extern LONG PRGFLAGS;
+extern int optim_flag;
 
 // Exported functions
 char * fext(char *, char *, int);