aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2008-02-18 02:08:13 +0800
committerXan Lopez <xan@src.gnome.org>2008-02-18 02:08:13 +0800
commit8b6ad442626717a523b284720ba2545cbeb84181 (patch)
tree6c3811e40d4d4ee2f5da73a1a8a95828425108da
parent6ae094e511afd9b3fda7041b998299a395cd6f14 (diff)
downloadgsoc2013-epiphany-8b6ad442626717a523b284720ba2545cbeb84181.tar.gz
gsoc2013-epiphany-8b6ad442626717a523b284720ba2545cbeb84181.tar.zst
gsoc2013-epiphany-8b6ad442626717a523b284720ba2545cbeb84181.zip
Add EPHY_CHECK_VERSION (#513128)
svn path=/trunk/; revision=7958
-rw-r--r--configure.ac6
-rw-r--r--src/Makefile.am1
-rw-r--r--src/ephy-version.h.in35
3 files changed, 42 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7e1bc5844..499aa22a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,6 +42,11 @@ AC_SUBST([EPIPHANY_MAJOR],[epiphany_version_major.epiphany_version_minor])
AC_SUBST([EPIPHANY_API_VERSION],[epiphany_version_major.epiphany_version_minor])
AC_SUBST([EPIPHANY_UA_VERSION])
+# for EPHY_CHECK_VERSION
+AC_SUBST([EPIPHANY_MAJOR_VERSION], [epiphany_version_major])
+AC_SUBST([EPIPHANY_MINOR_VERSION], [epiphany_version_minor])
+AC_SUBST([EPIPHANY_MICRO_VERSION], [epiphany_version_micro])
+
# Build ID
BUILDID="$(TZ=UTC0 date +'%Y%m%d')"
AC_SUBST([BUILDID])
@@ -794,6 +799,7 @@ embed/mozilla/Makefile
embed/webkit/Makefile
src/Makefile
src/bookmarks/Makefile
+src/ephy-version.h
help/Makefile
plugins/Makefile
plugins/desktop-file/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index bf9a39dd6..f34f5cfe3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,6 +52,7 @@ INST_H_FILES = \
ephy-shell.h \
ephy-statusbar.h \
ephy-window.h \
+ ephy-version.h \
$(NULL)
libephymain_la_SOURCES = \
diff --git a/src/ephy-version.h.in b/src/ephy-version.h.in
new file mode 100644
index 000000000..efc0e5aec
--- /dev/null
+++ b/src/ephy-version.h.in
@@ -0,0 +1,35 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* Copyright © 2008 Xan Lopez <xan@gnome.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef __EPHY_VERSION_H__
+#define __EPHY_VERSION_H__
+
+/* From GTK_CHECK_VERSION */
+
+#define EPHY_MAJOR_VERSION (@EPIPHANY_MAJOR_VERSION@)
+#define EPHY_MINOR_VERSION (@EPIPHANY_MINOR_VERSION@)
+#define EPHY_MICRO_VERSION (@EPIPHANY_MICRO_VERSION@)
+
+#define EPHY_CHECK_VERSION(major, minor, micro)\
+ (EPHY_MAJOR_VERSION > (major) || \
+ (EPHY_MAJOR_VERSION == (major) && EPHY_MINOR_VERSION > (minor)) || \
+ (EPHY_MAJOR_VERSION == (major) && EPHY_MINOR_VERSION == (minor) && \
+ EPHY_MICRO_VERSION >= (micro)))
+
+#endif