diff --git a/amx/amx.h b/amx/amx.h index bb8621e..63f6a17 100644 --- a/amx/amx.h +++ b/amx/amx.h @@ -219,10 +219,13 @@ typedef int (AMXAPI *AMX_IDLE)(struct tagAMX *amx, int AMXAPI Exec(struct tagAMX #pragma warning(disable:4103) /* disable warning message 4103 that complains about pragma pack in a header file */ #pragma warning(disable:4127) /* "conditional expression is constant" (needed for static_assert) */ #pragma warning(disable:4996) /* POSIX name is deprecated */ -#elif defined __GNUC__ #elif defined __clang__ - #pragma GCC diagnostic ignored "-Wlogical-op-parentheses" - #pragma GCC diagnostic ignored "-Wbitwise-op-parentheses" + #pragma clang diagnostic ignored "-Wlogical-op-parentheses" + #pragma clang diagnostic ignored "-Wbitwise-op-parentheses" + #pragma clang diagnostic ignored "-Wint-to-pointer-cast" +#elif defined __GNUC__ + #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" + #pragma GCC diagnostic ignored "-Wpointer-to-int-cast" #endif /* Some compilers do not support the #pragma align, which should be fine. Some @@ -380,7 +383,7 @@ enum { AMX_ERR_PARAMS, /* parameter error */ AMX_ERR_DOMAIN, /* domain error, expression result does not fit in range */ AMX_ERR_GENERAL, /* general error (unknown or unspecific error) */ - AMX_ERR_OVERLAY, /* overlays are unsupported (JIT) or uninitialized */ + AMX_ERR_OVERLAY /* overlays are unsupported (JIT) or uninitialized */ }; #define AMX_FLAG_OVERLAY 0x01 /* all function calls use overlays */ diff --git a/amx/amxfile.c b/amx/amxfile.c index c5d1ecc..52071de 100644 --- a/amx/amxfile.c +++ b/amx/amxfile.c @@ -93,7 +93,7 @@ #define _tgetenv getenv #define _tremove remove #define _trename rename - #if defined __APPLE__ + #if defined __LINUX__ || defined __FreeBSD__ || defined __OpenBSD__ || defined MACOS || defined __APPLE__ #define _tmkdir mkdir #define _trmdir rmdir #define _tstat stat diff --git a/amx/minIni.c b/amx/minIni.c index a784dbf..f5ca04d 100644 --- a/amx/minIni.c +++ b/amx/minIni.c @@ -81,6 +81,9 @@ #if !defined _totupper #define _totupper toupper #endif +#if !defined toupper + #define toupper(c) ( (c)>='A' && (c)<='Z' ? (c) + 'A' - 'a' : (c) ) +#endif #if !defined INI_LINETERM #if defined __LINUX__ || defined __FreeBSD__ || defined __OpenBSD__ || defined __APPLE__ diff --git a/compiler/sc1.c b/compiler/sc1.c index 422e50f..ed6033a 100644 --- a/compiler/sc1.c +++ b/compiler/sc1.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -37,6 +36,7 @@ #if defined __WIN32__ || defined _WIN32 || defined __MSDOS__ #include #include + #include #endif #if defined __GNUC__ || defined __clang__ #include @@ -638,15 +638,17 @@ int pc_compile(int argc, char *argv[]) make_report(&glbtab,frep,get_sourcefile(0),&makestategraph); fclose(frep); } /* if */ - if (makestategraph) { - /* run stategraph to create a dot file */ - char dotname[_MAX_PATH]; - char pgmname[_MAX_PATH]; - strcpy(dotname,reportname); - set_extension(dotname,".dot",TRUE); - sprintf(pgmname,"%s%cstategraph.exe",sc_binpath,DIRSEP_CHAR); - spawnl(P_WAIT,pgmname,pgmname,reportname,dotname,NULL); - } + #if defined __WIN32__ || defined _WIN32 || defined __MSDOS__ + if (makestategraph) { + /* run stategraph to create a dot file */ + char dotname[_MAX_PATH]; + char pgmname[_MAX_PATH]; + strcpy(dotname,reportname); + set_extension(dotname,".dot",TRUE); + sprintf(pgmname,"%s%cstategraph.exe",sc_binpath,DIRSEP_CHAR); + spawnl(P_WAIT,pgmname,pgmname,reportname,dotname,NULL); + } + #endif } /* if */ if (pc_globaldoc!=NULL) { free(pc_globaldoc);