diff --git a/AMBuildScript b/AMBuildScript index b205b941..af8abe5b 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -91,6 +91,7 @@ class AMXXConfig(object): '-Wall', '-Werror', '-Wno-uninitialized', + '-Wno-invalid-offsetof', '-Wno-unused', '-Wno-switch', '-m32', diff --git a/amxmodx/AMBuilder b/amxmodx/AMBuilder index 81787fc8..b114c591 100644 --- a/amxmodx/AMBuilder +++ b/amxmodx/AMBuilder @@ -24,12 +24,19 @@ elif builder.target_platform == 'linux': binary.Dep('JIT/helpers-x86.o'), ] +binary.compiler.linkflags += jit_objects + if builder.target_platform == 'linux': - binary.compiler.postlink += [binary.Dep('zlib/libz.a')] + binary.compiler.linkflags += [binary.Dep('zlib/libz.a')] elif builder.target_platform == 'mac': - binary.compiler.postlink += [binary.Dep('zlib/libz-darwin.a')] + binary.compiler.linkflags += [binary.Dep('zlib/libz-darwin.a')] elif builder.target_platform == 'windows': - binary.compiler.postlink += [binary.Dep('zlib\\zlib.lib')] + binary.compiler.linkflags += [binary.Dep('zlib\\zlib.lib')] + +if builder.target_platform == 'mac': + binary.compiler.postlink += [ + '-Wl,-read_only_relocs,suppress' + ] binary.sources = [ 'meta_api.cpp', @@ -79,6 +86,5 @@ binary.sources = [ 'datastructs.cpp', 'trie_natives.cpp', ] -binary.compiler.linkflags += jit_objects AMXX.binaries += [builder.Add(binary)] diff --git a/compiler/libpc300/sc1.c b/compiler/libpc300/sc1.c index 83fd68ae..a67daf20 100755 --- a/compiler/libpc300/sc1.c +++ b/compiler/libpc300/sc1.c @@ -487,7 +487,9 @@ int pc_compile(int argc, char *argv[]) tname=NULL; sname=NULL; #else - tname=tempnam(NULL,"pawn"); + char *buffer = strdup(P_tmpdir "/pawn.XXXXXX"); + close(mkstemp(buffer)); + tname=buffer; #endif ftmp=(FILE*)pc_createsrc(tname); for (fidx=0; (sname=get_sourcefile(fidx))!=NULL; fidx++) { @@ -1298,7 +1300,8 @@ static void setconfig(char *root) insert_path(path); /* same for the codepage root */ #if !defined NO_CODEPAGE - *ptr='\0'; + if (ptr) + *ptr='\0'; if (!cp_path(path,"codepage")) error(109,path); /* codepage path */ #endif