# HG changeset patch # User Teemu Piippo # Date 1452522788 -7200 # Node ID d8ecf07a76cf7d13ebb3a33575e4a74dc6d274bc # Parent c5ff5a4704dd07cfef8da2e866fe1c2cec6f7a58 Moved version definitions from version.h to version.cpp since they have no reason to be in the header file diff -r c5ff5a4704dd -r d8ecf07a76cf sources/version.cpp --- 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 #include +#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() diff -r c5ff5a4704dd -r d8ecf07a76cf sources/version.h --- 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();