mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-01-19 06:40:49 +00:00
Not defining GMQCC_VERSION_ in gmqcc.h but checking if they're defiend and #error if not - they're set in the Makefile - please fix windows builds
This commit is contained in:
parent
340de8379a
commit
a473979cf5
2 changed files with 13 additions and 3 deletions
7
Makefile
7
Makefile
|
@ -4,6 +4,10 @@ BINDIR := $(PREFIX)/bin
|
|||
DATADIR := $(PREFIX)/share
|
||||
MANDIR := $(DATADIR)/man
|
||||
|
||||
GMQCC_MAJOR=0
|
||||
GMQCC_MINOR=2
|
||||
GMQCC_PATCH=0
|
||||
|
||||
CC ?= clang
|
||||
CFLAGS += -Wall -Wextra -I. -pedantic-errors
|
||||
#turn on tons of warnings if clang is present
|
||||
|
@ -33,6 +37,9 @@ OBJ_T = test.o util.o con.o
|
|||
OBJ_C = main.o lexer.o parser.o
|
||||
OBJ_X = exec-standalone.o util.o con.o
|
||||
|
||||
CFLAGS += -DGMQCC_VERSION_MAJOR=$(GMQCC_MAJOR)
|
||||
CFLAGS += -DGMQCC_VERSION_MINOR=$(GMQCC_MINOR)
|
||||
CFLAGS += -DGMQCC_VERSION_PATCH=$(GMQCC_PATCH)
|
||||
|
||||
default: gmqcc
|
||||
%.o: %.c
|
||||
|
|
9
gmqcc.h
9
gmqcc.h
|
@ -41,9 +41,12 @@
|
|||
# pragma warning(disable : 4700 ) /* uninitialized local variable used */
|
||||
#endif
|
||||
|
||||
#define GMQCC_VERSION_MAJOR 0
|
||||
#define GMQCC_VERSION_MINOR 2
|
||||
#define GMQCC_VERSION_PATCH 0
|
||||
#if !defined(GMQCC_VERSION_MAJOR) \
|
||||
|| !defined(GMQCC_VERSION_MINOR) \
|
||||
|| !defined(GMQCC_VERSION_PATCH)
|
||||
# error GMQCC_VERSION_ macros missing
|
||||
#endif
|
||||
|
||||
#define GMQCC_VERSION_BUILD(J,N,P) (((J)<<16)|((N)<<8)|(P))
|
||||
#define GMQCC_VERSION \
|
||||
GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH)
|
||||
|
|
Loading…
Reference in a new issue