ocarina/include/version.tmpl
Bryan Schumaker 698d449c34 vers_str() needs to be static inline
Otherwise we could possibly have multiple definitions of it.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2012-04-07 10:01:14 -04:00

32 lines
652 B
Cheetah

#ifndef OCARINA_VERSION_H
#define OCARINA_VERSION_H
#include <string>
#include <sstream>
using namespace std;
static unsigned int MAJOR = __MAJOR__;
static unsigned int MINOR = __MINOR__;
static unsigned int BUG = __BUG__;
static string EXTRA = "__EXTRA__";
#ifdef DEBUG
static bool IS_DEBUG = true;
#else /* DEBUG */
static bool IS_DEBUG = false;
#endif /* DEBUG */
static inline string vers_str()
{
stringstream stream;
stream << MAJOR << "." << MINOR;
if (BUG != 0)
stream << "." << BUG;
if (EXTRA != "")
stream << "-" << EXTRA;
if (IS_DEBUG == true)
stream << "-" << "debug";
return stream.str();
}
#endif /* OCARINA_VERSION_H */