libsaria: Directly set version in version.h

Rather than building it up as part of a function call

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-06-02 12:14:39 -04:00
parent 698ed1508a
commit 7cc5cded9f
4 changed files with 14 additions and 21 deletions

View File

@ -7,6 +7,15 @@ BUG = 0
EXTRA = "rc"
DEBUG = True
# Find version
version = "%s.%s" % (MAJOR, MINOR)
if BUG != 0:
version = version + (".%s" % BUG)
if EXTRA != "":
version = version + ("-%s" % EXTRA)
if DEBUG == True:
version = version + "-debug"
# Install prefix
PREFIX = "/usr"

View File

@ -7,5 +7,6 @@ for line in open("version.tmpl", "r"):
line = line.replace("__MINOR__", str(MINOR))
line = line.replace("__BUG__", str(BUG))
line = line.replace("__EXTRA__", str(EXTRA))
line = line.replace("__VERSION__", str(version))
f.write(line)
f.close()

View File

@ -2,30 +2,10 @@
#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();
return "__VERSION__";
}
#endif /* OCARINA_VERSION_H */

View File

@ -9,6 +9,9 @@
#include <libsaria/prefs.h>
#include <libsaria/deck.h>
#include <sstream>
using namespace std;
static GtkWidget *win;
static int old_w, old_h;
static bool ignore_configure_event = false;