From 5f149946d6d67cc85bd537a04bf4a487510b10d1 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 30 Nov 2008 01:22:03 +0100 Subject: [PATCH] Implement MIDORI_CHECK_VERSION for use in extensions --- midori/midori.h | 6 ++++++ wscript | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/midori/midori.h b/midori/midori.h index a456ac88..7a4dd10e 100644 --- a/midori/midori.h +++ b/midori/midori.h @@ -31,4 +31,10 @@ /* For convenience, include localization header */ #include +#define MIDORI_CHECK_VERSION(major, minor, micro) \ + (MIDORI_MAJOR_VERSION > (major) || \ + (MIDORI_MAJOR_VERSION == (major) && MIDORI_MINOR_VERSION > (minor)) || \ + (MIDORI_MAJOR_VERSION == (major) && MIDORI_MINOR_VERSION == (minor) && \ + MIDORI_MICRO_VERSION >= (micro))) + #endif /* __MIDORI_H__ */ diff --git a/wscript b/wscript index 34f31a61..4cc24f6f 100644 --- a/wscript +++ b/wscript @@ -9,8 +9,12 @@ import sys import os import UnitTest +major = 0 +minor = 1 +micro = 0 + APPNAME = 'midori' -VERSION = '0.1.0' +VERSION = str (major) + '.' + str (minor) + '.' + str (micro) try: git = subprocess.Popen (['git', 'rev-parse', '--short', 'HEAD'], @@ -127,6 +131,10 @@ def configure (conf): conf.define ('PACKAGE_BUGREPORT', 'http://www.twotoasts.de/bugs') conf.define ('GETTEXT_PACKAGE', APPNAME) + conf.define ('MIDORI_MAJOR_VERSION', major) + conf.define ('MIDORI_MINOR_VERSION', minor) + conf.define ('MIDORI_MICRO_VERSION', micro) + conf.write_config_header ('config.h') conf.env.append_value ('CCFLAGS', '-DHAVE_CONFIG_H')