Mon, 11 Jan 2016 16:33:08 +0200
Moved version definitions from version.h to version.cpp since they have no reason to be in the header file
sources/version.cpp | file | annotate | diff | comparison | revisions | |
sources/version.h | file | annotate | diff | comparison | revisions |
--- a/sources/version.cpp Mon Jan 11 16:27:53 2016 +0200 +++ b/sources/version.cpp Mon Jan 11 16:33:08 2016 +0200 @@ -35,9 +35,32 @@ #include <stdio.h> #include <string.h> +#include "basics.h" #include "version.h" #include "hginfo.h" +#define VERSION_MAJOR 1 +#define VERSION_MINOR 2 +#define VERSION_PATCH 0 + +#if VERSION_PATCH == 0 +# define VERSION_STRING \ + MACRO_TO_STRING (VERSION_MAJOR) \ + "." MACRO_TO_STRING (VERSION_MINOR) +#else +# define VERSION_STRING \ + MACRO_TO_STRING (VERSION_MAJOR) \ + "." MACRO_TO_STRING (VERSION_MINOR) \ + "." MACRO_TO_STRING (VERSION_PATCH) +#endif + +// ------------------------------------------------------------------------------------------------- +// +const char* version_string() +{ + return VERSION_STRING; +} + // ------------------------------------------------------------------------------------------------- // const char* full_version_string()
--- a/sources/version.h Mon Jan 11 16:27:53 2016 +0200 +++ b/sources/version.h Mon Jan 11 16:33:08 2016 +0200 @@ -29,33 +29,10 @@ */ #pragma once -#include "basics.h" #define APPNAME "zfc9000" -#define VERSION_MAJOR 1 -#define VERSION_MINOR 2 -#define VERSION_PATCH 0 - -// ------------------------------------------------------------------------------------------------- -// Version string -#if VERSION_PATCH == 0 -# define VERSION_STRING \ - MACRO_TO_STRING (VERSION_MAJOR) \ - "." MACRO_TO_STRING (VERSION_MINOR) -#else -# define VERSION_STRING \ - MACRO_TO_STRING (VERSION_MAJOR) \ - "." MACRO_TO_STRING (VERSION_MINOR) \ - "." MACRO_TO_STRING (VERSION_PATCH) -#endif - -// ------------------------------------------------------------------------------------------------- // Returns the bare version string (1.2.3) - -inline const char* version_string() -{ - return VERSION_STRING; -} +const char* version_string(); // Returns full version string, with hash (1.2.3-abcd456) const char* full_version_string();