From: TimePath Date: Wed, 30 Dec 2015 02:17:42 +0000 (+1100) Subject: ftepp: remove X-Git-Tag: xonotic-v0.8.2~1359 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d19f84384ff518328d50bfebc9007ef56162f2d;p=xonotic%2Fxonotic-data.pk3dir.git ftepp: remove --- diff --git a/qcsrc/Makefile b/qcsrc/Makefile index 0294374a0..3ff138f2c 100644 --- a/qcsrc/Makefile +++ b/qcsrc/Makefile @@ -2,7 +2,9 @@ SCM := $(shell if [ -d .svn ]; then echo svn; elif [ -d ../.git ]; then echo git PERL ?= perl QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' QCC ?= gmqcc +QCCDEFS_EXTRA ?= -DGMQCC NDEBUG ?= 1 +BUILD_MOD ?= 0 QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversion.txt && git hash-object qccversion.txt) @@ -10,21 +12,21 @@ QCCVERSIONFILE := qccversion.$(shell (cd server && $(QCC) --version) > qccversio QCCFLAGS_WTFS ?= \ -Wno-field-redeclared -QCCFLAGS_FEATURES ?= \ - -DBUILD_MOD=$(BUILD_MOD) +QCCDEFS ?= \ + $(QCCFLAGS_WATERMARK) \ + -DNDEBUG=$(NDEBUG) \ + -DBUILD_MOD=$(BUILD_MOD) \ + $(QCCDEFS_EXTRA) # -Ooverlap-locals is required QCCFLAGS ?= \ -std=gmqcc \ -Ooverlap-locals \ -O3 \ - -Werror -Wall -Wcpp \ + -Werror -Wall \ $(QCCFLAGS_WTFS) \ - -fftepp -flno -futf8 -fno-bail-on-werror -fftepp-predefs \ + -flno -futf8 -fno-bail-on-werror \ -frelaxed-switch -freturn-assignments \ - $(QCCFLAGS_WATERMARK) \ - -DNDEBUG=$(NDEBUG) \ - $(QCCFLAGS_FEATURES) \ $(QCCFLAGS_EXTRA) # xonotic build system overrides this by command line argument to turn off the update-cvarcount step @@ -39,30 +41,36 @@ qc: ../menu.dat ../progs.dat ../csprogs.dat .PHONY: clean clean: rm -f ../progs.dat ../menu.dat ../csprogs.dat - rm -f progs.d menu.d csprogs.d + rm -f tmp/*.qc tmp/*.d tmp/*.txt $(QCCVERSIONFILE): $(RM) qccversion.* echo This file intentionally left blank. > $@ ../csprogs.dat: client/progs.inc $(QCCVERSIONFILE) - @$(CC) -MM -MP -MF csprogs.d -MT $@ -x c -DCSQC -o $@ $< + @$(CC) -xc $(QCCDEFS) -DCSQC -E -dM 1>tmp/client_macros.txt -H 2>tmp/client_includes.txt $< + $(CC) -xc $(QCCDEFS) -DCSQC -E -MMD -MP -MT $@ -Wall -Wundef -Werror -CC -o tmp/client.qc $< + @sed -i 's/^# \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\2)\n#pragma line(\1)/g' tmp/client.qc @echo make[1]: Entering directory \`$(PWD)/client\' - cd client && $(QCC) $(QCCFLAGS) -DCSQC -o ../$@ ../$< --include csprogs.d + cd client && $(QCC) $(QCCFLAGS) -o ../$@ ../tmp/client.qc +-include tmp/client.d ../progs.dat: server/progs.inc $(QCCVERSIONFILE) - @$(CC) -MM -MP -MF progs.d -MT $@ -x c -DSVQC -o $@ $< + @$(CC) -xc $(QCCDEFS) -DSVQC -E -dM 1>tmp/server_macros.txt -H 2>tmp/server_includes.txt $< + $(CC) -xc $(QCCDEFS) -DSVQC -E -MMD -MP -MT $@ -Wall -Wundef -Werror -CC -o tmp/server.qc $< + @sed -i 's/^# \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\2)\n#pragma line(\1)/g' tmp/server.qc @echo make[1]: Entering directory \`$(PWD)/server\' - cd server && $(QCC) $(QCCFLAGS) -DSVQC -o ../$@ ../$< --include progs.d + cd server && $(QCC) $(QCCFLAGS) -o ../$@ ../tmp/server.qc +-include tmp/server.d ../menu.dat: menu/progs.inc $(QCCVERSIONFILE) - @$(CC) -MM -MP -MF menu.d -MT $@ -x c -DMENUQC -o $@ $< + @$(CC) -xc $(QCCDEFS) -DMENUQC -E -dM 1>tmp/menu_macros.txt -H 2>tmp/menu_includes.txt $< + $(CC) -xc $(QCCDEFS) -DMENUQC -E -MMD -MP -MT $@ -Wall -Wundef -Werror -CC -o tmp/menu.qc $< + @sed -i 's/^# \([[:digit:]]\+\) "\(.*\)".*/\n#pragma file(\2)\n#pragma line(\1)/g' tmp/menu.qc @echo make[1]: Entering directory \`$(PWD)/menu\' - cd menu && $(QCC) $(QCCFLAGS) -DMENUQC -o ../$@ ../$< --include menu.d + cd menu && $(QCC) $(QCCFLAGS) -o ../$@ ../tmp/menu.qc +-include tmp/menu.d .PHONY: testcase testcase: - cd testcase && $(QCC) $(QCCFLAGS) -DTESTCASE="$$TESTCASE" + cd testcase && $(QCC) $(QCCDEFS) $(QCCFLAGS) -DTESTCASE="$$TESTCASE" diff --git a/qcsrc/lib/misc.qh b/qcsrc/lib/misc.qh index cecb15a11..5dd3e7739 100644 --- a/qcsrc/lib/misc.qh +++ b/qcsrc/lib/misc.qh @@ -1,12 +1,7 @@ #ifndef MISC_H #define MISC_H -#ifdef GMQCC - #define EVAL(...) __VA_ARGS__ - - #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__) - #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__) -#else +#ifdef __STDC__ #define EMPTY() #define DEFER(id) id EMPTY() @@ -21,6 +16,11 @@ #define OVERLOAD__(F, ...) OVERLOAD___(F,##__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) #define OVERLOAD_(...) DEFER(OVERLOAD__(__VA_ARGS__)) #define OVERLOAD(F, ...) OVERLOAD_(F,##__VA_ARGS__)(__VA_ARGS__) +#else + #define EVAL(...) __VA_ARGS__ + + #define OVERLOAD_(F, ...) F##_##__VA_COUNT__(__VA_ARGS__) + #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__) #endif #if defined(CSQC) diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index 05a20dc19..ca98d4fe1 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -99,13 +99,7 @@ void clearentity(entity e) // The parameter is used across [[accumulate]] functions // Macros to hide this implementation detail: -#ifdef GMQCC - #define NEW(cname, ...) \ - OVERLOAD(spawn##cname, new_pure(cname),##__VA_ARGS__) - - #define CONSTRUCT(cname, ...) \ - OVERLOAD(spawn##cname, this,##__VA_ARGS__) -#else +#ifdef __STDC__ #define NEW_(cname, ...) \ OVERLOAD_(spawn##cname, __VA_ARGS__) #define NEW(cname, ...) \ @@ -115,6 +109,12 @@ void clearentity(entity e) OVERLOAD_(spawn##cname, __VA_ARGS__) #define CONSTRUCT(cname, ...) \ CONSTRUCT_(cname, this,##__VA_ARGS__)(this,##__VA_ARGS__) +#else + #define NEW(cname, ...) \ + OVERLOAD(spawn##cname, new_pure(cname),##__VA_ARGS__) + + #define CONSTRUCT(cname, ...) \ + OVERLOAD(spawn##cname, this,##__VA_ARGS__) #endif #define CONSTRUCTOR(cname, ...) \ diff --git a/qcsrc/tmp/.gitignore b/qcsrc/tmp/.gitignore new file mode 100644 index 000000000..5e7d2734c --- /dev/null +++ b/qcsrc/tmp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore