From: Wolfgang Bumiller Date: Thu, 10 Jan 2013 15:07:33 +0000 (+0100) Subject: --version now prints GMQCC_GITINFO, which is not not defined in gmqcc.h to some empty... X-Git-Tag: before-library~326 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7a5a328c544f0f555f5ff8de28e27706ce06708c;p=xonotic%2Fgmqcc.git --version now prints GMQCC_GITINFO, which is not not defined in gmqcc.h to some empty string, it just won't exist in release builds --- diff --git a/Makefile b/Makefile index 52e7270..1d8b1c4 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ MINGW = $(findstring MINGW32, $(UNAME)) CC ?= clang CFLAGS += -Wall -Wextra -I. -fno-strict-aliasing -fsigned-char -CFLAGS += -DGMQCC_GITINFO="`git describe`" +CFLAGS += -DGMQCC_GITINFO="\"`git describe`\"" #turn on tons of warnings if clang is present # but also turn off the STUPID ONES ifeq ($(CC), clang) diff --git a/gmqcc.h b/gmqcc.h index b9aca83..b1657ff 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -46,10 +46,6 @@ #define GMQCC_VERSION \ GMQCC_VERSION_BUILD(GMQCC_VERSION_MAJOR, GMQCC_VERSION_MINOR, GMQCC_VERSION_PATCH) -#ifndef GMQCC_GITINFO -# define GMQCC_GITINFO "(no git info)" -#endif - /* * We cannot rely on C99 at all, since compilers like MSVC * simply don't support it. We define our own boolean type diff --git a/main.c b/main.c index 0658677..ff0e41d 100644 --- a/main.c +++ b/main.c @@ -51,6 +51,9 @@ static void version() { __DATE__, __TIME__ ); +#ifdef GMQCC_GITINFO + con_out("git build: %s\n", GMQCC_GITINFO); +#endif } static int usage() {