From d67e544e6a97be82fad02b80625eb17692dec87a Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 11 Jun 2008 23:27:21 +0000 Subject: [PATCH] Added workaround for XULRunner 1.9's requirement of 16-bit wchar_t. Changing the definition of wchar_t breaks the ABI and results in a linker error on armel. The Makefile now removes -fshort-wchar from compiler options. All files including Mozilla headers bracket them with #include "wchar_t_short.h" ... #include "wchar_t_default.h". wchar_t_short.h defines wchar_t as a macro expanding to uint16_t and wchar_t_default.h undefines the macro. --- ChangeLog | 6 ++++++ Makefile | 3 ++- browser_widget.cpp | 2 ++ browser_widget.hpp | 2 ++ child_iterator.hpp | 2 ++ debian/changelog | 7 +++++++ event_state_manager.cpp | 2 ++ link_iterator.hpp | 2 ++ null_prompt_service.cpp | 2 ++ null_prompt_service.hpp | 2 ++ style_sheets.cpp | 2 ++ videolink.cpp | 2 ++ wchar_t_default.h | 1 + wchar_t_short.h | 3 +++ xpcom_support.hpp | 2 ++ 15 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 wchar_t_default.h create mode 100644 wchar_t_short.h diff --git a/ChangeLog b/ChangeLog index 5b73aeb..5cb546d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +videolink (1.2.5) unstable; urgency=low + + * Added workaround for XULRunner 1.9's requirement of 16-bit wchar_t + + -- Ben Hutchings Thu, 12 Jun 2008 00:20:54 +0100 + videolink (1.2.4) unstable; urgency=low * Fixed warning messages from make when first compiled diff --git a/Makefile b/Makefile index 9a62d7e..d0bd997 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,8 @@ $(sources_using_gtkmm:%.cpp=.objs/%.o) \ : CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.4) $(sources_using_moz:%.cpp=.objs/%.o) \ - : CPPFLAGS += $(shell pkg-config --cflags $(moz_pc)) $(moz_cppflags_extra) + : CPPFLAGS += $(filter-out -fshort-wchar, \ + $(shell pkg-config --cflags $(moz_pc)) $(moz_cppflags_extra)) # Non-virtual destructors are fine in XPCOM interface classes since # instances are only ever called by the Release function which is virtual. $(sources_using_moz:%.cpp=.objs/%.o) : CXXFLAGS += -Wno-non-virtual-dtor diff --git a/browser_widget.cpp b/browser_widget.cpp index 3b7a2d4..baa0748 100644 --- a/browser_widget.cpp +++ b/browser_widget.cpp @@ -8,10 +8,12 @@ #include +#include "wchar_t_short.h" #include #if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9 #include #endif +#include "wchar_t_default.h" #include "xpcom_support.hpp" diff --git a/browser_widget.hpp b/browser_widget.hpp index 456067b..fdf18ce 100644 --- a/browser_widget.hpp +++ b/browser_widget.hpp @@ -7,8 +7,10 @@ #include #include +#include "wchar_t_short.h" #include #include +#include "wchar_t_default.h" class browser_widget; class nsIWebBrowser; diff --git a/child_iterator.hpp b/child_iterator.hpp index 53d88d3..9c58313 100644 --- a/child_iterator.hpp +++ b/child_iterator.hpp @@ -6,8 +6,10 @@ #include +#include "wchar_t_short.h" #include #include +#include "wchar_t_default.h" class child_iterator : public std::iterator, diff --git a/debian/changelog b/debian/changelog index 50fbdb6..c2390d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +videolink (1.2.5-1) unstable; urgency=low + + * New upstream version + - Adds workaround for bug #485876 + + -- Ben Hutchings Thu, 12 Jun 2008 00:22:20 +0100 + videolink (1.2.4-1) unstable; urgency=low * New upstream version diff --git a/event_state_manager.cpp b/event_state_manager.cpp index 50b068a..3fde68d 100644 --- a/event_state_manager.cpp +++ b/event_state_manager.cpp @@ -4,8 +4,10 @@ #ifndef MOZILLA_INTERNAL_API #define MOZILLA_INTERNAL_API #endif +#include "wchar_t_short.h" #include #include +#include "wchar_t_default.h" #include "event_state_manager.hpp" #include "xpcom_support.hpp" diff --git a/link_iterator.hpp b/link_iterator.hpp index ceadc6d..b56e69b 100644 --- a/link_iterator.hpp +++ b/link_iterator.hpp @@ -6,9 +6,11 @@ #include +#include "wchar_t_short.h" #include #include #include +#include "wchar_t_default.h" class nsIDOMDocument; diff --git a/null_prompt_service.cpp b/null_prompt_service.cpp index 2548512..68d6d90 100644 --- a/null_prompt_service.cpp +++ b/null_prompt_service.cpp @@ -6,6 +6,7 @@ #include +#include "wchar_t_short.h" #include #include #include @@ -13,6 +14,7 @@ #include #include #include +#include "wchar_t_default.h" #include "null_prompt_service.hpp" #include "videolink.hpp" diff --git a/null_prompt_service.hpp b/null_prompt_service.hpp index c3b6951..464b809 100644 --- a/null_prompt_service.hpp +++ b/null_prompt_service.hpp @@ -1,7 +1,9 @@ #ifndef INC_NULL_PROMPT_SERVICE_HPP #define INC_NULL_PROMPT_SERVICE_HPP +#include "wchar_t_short.h" #include +#include "wchar_t_default.h" class null_prompt_service : public nsIPromptService { diff --git a/style_sheets.cpp b/style_sheets.cpp index 9cd6273..6093585 100644 --- a/style_sheets.cpp +++ b/style_sheets.cpp @@ -3,12 +3,14 @@ #include "style_sheets.hpp" +#include "wchar_t_short.h" #include #include #include #include #include #include +#include "wchar_t_default.h" #include "xpcom_support.hpp" diff --git a/videolink.cpp b/videolink.cpp index 1d473fa..9ed1746 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -22,6 +22,7 @@ #include #include +#include "wchar_t_short.h" #include #if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR == 9 #include @@ -56,6 +57,7 @@ typedef nsCOMPtr nsWeakPtr; #else #include #endif +#include "wchar_t_default.h" #include "browser_widget.hpp" #include "child_iterator.hpp" diff --git a/wchar_t_default.h b/wchar_t_default.h new file mode 100644 index 0000000..59028f6 --- /dev/null +++ b/wchar_t_default.h @@ -0,0 +1 @@ +#undef wchar_t diff --git a/wchar_t_short.h b/wchar_t_short.h new file mode 100644 index 0000000..7377c36 --- /dev/null +++ b/wchar_t_short.h @@ -0,0 +1,3 @@ +#include +#undef wchar_t +#define wchar_t uint16_t diff --git a/xpcom_support.hpp b/xpcom_support.hpp index 4fc983f..b3a6fd1 100644 --- a/xpcom_support.hpp +++ b/xpcom_support.hpp @@ -6,7 +6,9 @@ #include +#include "wchar_t_short.h" #include +#include "wchar_t_default.h" namespace xpcom_support { -- 2.39.5