Browse Source

Fixes for pre c99.

Brucey 3 years ago
parent
commit
1c432a3783

+ 1 - 1
blitz.mod/blitz_app.c

@@ -381,7 +381,7 @@ void bbDelay( int millis ){
 	}
 }
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 extern void bbUDelay( int microseconds );
 #else
 void bbUDelay( int microseconds ) {

+ 1 - 1
blitz.mod/blitz_app.h

@@ -34,7 +34,7 @@ void		bbWriteStderr( BBString *t );
 void		bbDelay( int ms );
 int		bbMilliSecs();
 int		bbIsMainThread();
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 #ifndef _WIN32
 #include <unistd.h>
 inline void bbUDelay( int microseconds ) {

+ 1 - 1
blitz.mod/blitz_cclib.c

@@ -1,7 +1,7 @@
 
 #include "blitz.h"
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 extern int bbIntAbs( int x );
 extern int bbIntSgn( int x );

+ 1 - 5
blitz.mod/blitz_cclib.h

@@ -18,11 +18,7 @@ extern "C"{
 #define bbNEGINFf (-1.0f/0.0f)
 #define bbNEGINFd (-1.0/0.0)
 
-#ifndef __STDC_VERSION__
-	#define __STDC_VERSION__ 0
-#endif
-
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
 inline int bbIntAbs( int x ){
 	return x>=0 ? x : -x;

+ 1 - 1
blitz.mod/blitz_object.c

@@ -312,7 +312,7 @@ BBDebugScope * bbObjectEnumInfo( char * name ) {
 	return 0;
 }
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 extern void * bbObjectToFieldOffset(BBOBJECT o);
 #else
 void * bbObjectToFieldOffset(BBOBJECT o) {

+ 1 - 1
blitz.mod/blitz_object.h

@@ -112,7 +112,7 @@ struct enum_node {
 void bbObjectRegisterEnum( BBDebugScope *p );
 BBDebugScope * bbObjectEnumInfo( char * name );
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 inline void * bbObjectToFieldOffset(BBOBJECT o) {
 	return (void*)(((unsigned char*)o) + o->clas->fields_offset);
 }

+ 1 - 1
blitz.mod/blitz_string.c

@@ -1016,7 +1016,7 @@ char *bbTmpUTF8String( BBString *str ){
 	return p;
 }
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 extern int bbStringEquals( BBString *x,BBString *y);
 extern int bbObjectIsEmptyString(BBObject * o);
 extern BBULONG bbStringHash( BBString * x );

+ 1 - 1
blitz.mod/blitz_string.h

@@ -170,7 +170,7 @@ char*	bbTmpCString( BBString *str );
 BBChar*	bbTmpWString( BBString *str );
 char*	bbTmpUTF8String( BBString *str );
 
-#if __STDC_VERSION__ >= 199901L
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 inline int bbStringEquals( BBString *x,BBString *y ){
 	if (x->length-y->length != 0) return 0;
 	if (x->hash != 0 && x->hash == y->hash) return 1;