Bob Polis
c83be332d5
Made version and commit variables static, and local to the version display function. Previously, they would be globals, and as such would collide with those from linked shared libraries. Now, all project types will have them local.
20 lines
452 B
C++
20 lines
452 B
C++
#include "version.hpp"
|
|
#include <sstream>
|
|
|
|
std::string {PROJECT}_version() {
|
|
#include "version.inc"
|
|
#include "commit.inc"
|
|
std::ostringstream oss;
|
|
oss << "{PROJECT} version " << version;
|
|
#ifdef DEBUG
|
|
oss << " DEBUG";
|
|
#endif
|
|
oss << '\n';
|
|
if (commit[0] != '\0') {
|
|
oss << "build " << commit << ", ";
|
|
}
|
|
oss << __DATE__ << ", " << __TIME__ << '\n';
|
|
oss << "(c) Bob Polis, all rights reserved";
|
|
return oss.str();
|
|
}
|