From c13366d910ebbdfc30c8b399ff29161747537d1c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 3 Apr 2017 10:47:47 +0200 Subject: Redo version header --- bbot/agent.cxx | 2 -- bbot/bbot-version | 81 ------------------------------------------------------- bbot/buildfile | 2 +- bbot/utility | 1 + bbot/version-impl | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 84 deletions(-) delete mode 100644 bbot/bbot-version create mode 100644 bbot/version-impl diff --git a/bbot/agent.cxx b/bbot/agent.cxx index 54940f4..a8c1b6e 100644 --- a/bbot/agent.cxx +++ b/bbot/agent.cxx @@ -16,8 +16,6 @@ #include #include -#include - #include using namespace std; diff --git a/bbot/bbot-version b/bbot/bbot-version deleted file mode 100644 index 84dc85d..0000000 --- a/bbot/bbot-version +++ /dev/null @@ -1,81 +0,0 @@ -// file : bbot/bbot-version -*- C++ -*- -// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd -// license : MIT; see accompanying LICENSE file - -#ifndef BBOT_VERSION // Note: using the version macro itself. - -#include // LIBBUTL_VERSION -#include // LIBBBOT_VERSION - -// Version format is AABBCCDD where -// -// AA - major version number -// BB - minor version number -// CC - bugfix version number -// DD - alpha / beta (DD + 50) version number -// -// When DD is not 00, 1 is subtracted from AABBCC. For example: -// -// Version AABBCCDD -// 2.0.0 02000000 -// 2.1.0 02010000 -// 2.1.1 02010100 -// 2.2.0-a1 02019901 -// 3.0.0-b2 02999952 -// -#define BBOT_VERSION 49901 -#define BBOT_VERSION_STR "0.5.0-a1" - -// Generally, we expect minor versions to be source code backwards- -// compatible, thought we might have a minimum version requirement. -// -// Note: does not apply during early development. -// -#if LIBBUTL_VERSION != 49901 -# error incompatible libbutl version -#endif - -#if LIBBBOT_VERSION != 49901 -# error incompatible libbbot version -#endif - -// User agent. -// -#if defined(_WIN32) -# if defined(__MINGW32__) -# define BBOT_OS "MinGW" -# else -# define BBOT_OS "Windows" -# endif -#elif defined(__linux) -# define BBOT_OS "GNU/Linux" -#elif defined(__APPLE__) -# define BBOT_OS "MacOS" -#elif defined(__CYGWIN__) -# define BBOT_OS "Cygwin" -#elif defined(__FreeBSD__) -# define BBOT_OS "FreeBSD" -#elif defined(__OpenBSD__) -# define BBOT_OS "OpenBSD" -#elif defined(__NetBSD__) -# define BBOT_OS "NetBSD" -#elif defined(__sun) -# define BBOT_OS "Solaris" -#elif defined(__hpux) -# define BBOT_OS "HP-UX" -#elif defined(_AIX) -# define BBOT_OS "AIX" -#elif defined(__unix) -# define BBOT_OS "Unix" -#elif defined(__posix) -# define BBOT_OS "Posix" -#else -# define BBOT_OS "Other" -#endif - -#define BBOT_USER_AGENT \ - "bbot/" BBOT_VERSION_STR " (" BBOT_OS "; +https://build2.org)" \ - " libbbot/" LIBBBOT_VERSION_STR \ - " libbutl/" LIBBUTL_VERSION_STR - -#endif // BBOT_VERSION diff --git a/bbot/buildfile b/bbot/buildfile index 1f48062..bcd0b93 100644 --- a/bbot/buildfile +++ b/bbot/buildfile @@ -7,12 +7,12 @@ import libs += libbbot%lib{bbot} exe{bbot-agent}: \ { cxx}{ agent } {hxx ixx cxx}{ agent-options } \ -{hxx }{ bbot-version } \ {hxx ixx cxx}{ common-options } \ {hxx cxx}{ diagnostics } \ {hxx }{ types } \ {hxx cxx}{ types-parsers } \ {hxx cxx}{ utility } \ +{hxx }{ version-impl } \ $libs # Generated options parser. diff --git a/bbot/utility b/bbot/utility index 05e90c7..032ffca 100644 --- a/bbot/utility +++ b/bbot/utility @@ -18,6 +18,7 @@ #include #include +#include namespace bbot { diff --git a/bbot/version-impl b/bbot/version-impl new file mode 100644 index 0000000..0205167 --- /dev/null +++ b/bbot/version-impl @@ -0,0 +1,81 @@ +// file : bbot/version-impl -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BBOT_VERSION // Note: using the version macro itself. + +#include // LIBBUTL_VERSION +#include // LIBBBOT_VERSION + +// Version format is AABBCCDD where +// +// AA - major version number +// BB - minor version number +// CC - bugfix version number +// DD - alpha / beta (DD + 50) version number +// +// When DD is not 00, 1 is subtracted from AABBCC. For example: +// +// Version AABBCCDD +// 2.0.0 02000000 +// 2.1.0 02010000 +// 2.1.1 02010100 +// 2.2.0-a1 02019901 +// 3.0.0-b2 02999952 +// +#define BBOT_VERSION 49901 +#define BBOT_VERSION_STR "0.5.0-a1" + +// Generally, we expect minor versions to be source code backwards- +// compatible, thought we might have a minimum version requirement. +// +// Note: does not apply during early development. +// +#if LIBBUTL_VERSION != 49901 +# error incompatible libbutl version +#endif + +#if LIBBBOT_VERSION != 49901 +# error incompatible libbbot version +#endif + +// User agent. +// +#if defined(_WIN32) +# if defined(__MINGW32__) +# define BBOT_OS "MinGW" +# else +# define BBOT_OS "Windows" +# endif +#elif defined(__linux) +# define BBOT_OS "GNU/Linux" +#elif defined(__APPLE__) +# define BBOT_OS "MacOS" +#elif defined(__CYGWIN__) +# define BBOT_OS "Cygwin" +#elif defined(__FreeBSD__) +# define BBOT_OS "FreeBSD" +#elif defined(__OpenBSD__) +# define BBOT_OS "OpenBSD" +#elif defined(__NetBSD__) +# define BBOT_OS "NetBSD" +#elif defined(__sun) +# define BBOT_OS "Solaris" +#elif defined(__hpux) +# define BBOT_OS "HP-UX" +#elif defined(_AIX) +# define BBOT_OS "AIX" +#elif defined(__unix) +# define BBOT_OS "Unix" +#elif defined(__posix) +# define BBOT_OS "Posix" +#else +# define BBOT_OS "Other" +#endif + +#define BBOT_USER_AGENT \ + "bbot/" BBOT_VERSION_STR " (" BBOT_OS "; +https://build2.org)" \ + " libbbot/" LIBBBOT_VERSION_STR \ + " libbutl/" LIBBUTL_VERSION_STR + +#endif // BBOT_VERSION -- cgit v1.1