]> git.decadent.org.uk Git - videolink.git/commitdiff
Update version checks for XULRunner 2.0 (beta)
authorBen Hutchings <ben@decadent.org.uk>
Thu, 3 Mar 2011 02:48:37 +0000 (02:48 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Mar 2011 02:48:37 +0000 (02:48 +0000)
browser_widget.cpp
videolink.cpp
videolink.hpp

index 01ce4cbfe308f4da068a96c0b47c448b46d5233d..d45970aa045f6a1c3051dbafb182c0e42c3cc0c1 100644 (file)
@@ -8,9 +8,10 @@
 
 #include <limits.h>
 
+#include "videolink.hpp"
 #include "wchar_t_short.h"
 #include <gtkmozembed_internal.h>
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
 #include <gtkmozembed_glue.cpp>
 #endif
 #include "wchar_t_default.h"
@@ -530,14 +531,17 @@ Glib::ObjectBase * browser_widget::wrap_new(GObject * gobject)
 
 browser_widget::initialiser::initialiser()
 {
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
     static const GREVersionRange gre_versions = {
-#if MOZ_VERSION_MICRO == 0
+#if MOZ_VERSION_EQ(1,9,0)
        "1.9a", PR_TRUE,
        "1.9.1", PR_FALSE
-#elif MOZ_VERSION_MICRO == 1
+#elif MOZ_VERSION_EQ(1,9,1)
        "1.9.1", PR_TRUE,
        "1.9.2", PR_FALSE
+#elif MOZ_VERSION_EQ(2,0,-1) || MOZ_VERSION_EQ(2,0,0)
+       "2.0b", PR_TRUE,
+       "2.0.1", PR_FALSE
 #else
 #error "version is unsupported, but you could try continuing the pattern above"
 #endif
@@ -567,7 +571,7 @@ browser_widget::initialiser::~initialiser()
 {
     gtk_moz_embed_pop_startup();
 
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
     XPCOMGlueShutdown();
 #endif
 }
index 9ed174675f2a85d45f58737ded4d62a1d802677c..e0b71d8acc981ddf3b7aee6a2bdda2f26475ead8 100644 (file)
 #include <gtkmm/main.h>
 #include <gtkmm/window.h>
 
+#include "videolink.hpp"
 #include "wchar_t_short.h"
 #include <ImageErrors.h>
-#if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9
+#if MOZ_VERSION_GE(1,9,0)
 #include <nsWeakPtr.h>
 /* For some reason <nsWeakPtr.h> no longer defines this */
 typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;
index db3eedeb9ff867d8154f6b4865fa627f3b302203..c2c1e89b1605a80ef6545da7feab760aff3c7cfe 100644 (file)
@@ -5,4 +5,14 @@
 
 void fatal_error(const std::string & message);
 
+#define MOZ_VERSION_EQ(major, minor, micro)                            \
+    (MOZ_VERSION_MAJOR == (major) &&                                   \
+     MOZ_VERSION_MINOR == (minor) &&                                   \
+     MOZ_VERSION_MICRO == (micro))
+#define MOZ_VERSION_GE(major, minor, micro)                            \
+    (MOZ_VERSION_MAJOR > (major) ||                                    \
+     (MOZ_VERSION_MAJOR == (major) &&                                  \
+      (MOZ_VERSION_MINOR > (minor) ||                                  \
+       (MOZ_VERSION_MINOR == (minor) && MOZ_VERSION_MICRO >= (micro)))))
+
 #endif // !INC_VIDEOLINK_HPP