Bug 1550422 - P21. Fix Linux compilation. r?karlt! draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 17 May 2019 00:01:48 +1000
changeset 2008597 bbe6abfb20cbc75134a697755e03d5366c171a33
parent 2008596 11ee7cc6ced3d845f3f44285774af0f800ce8f2a
child 2008598 917b14906154d94f69611edf2dbec066f25a108e
push id363925
push userjyavenard@mozilla.com
push dateSat, 18 May 2019 07:53:18 +0000
treeherdertry@5082cd581229 [default view] [failures only]
reviewerskarlt
bugs1550422
milestone68.0a1
Bug 1550422 - P21. Fix Linux compilation. r?karlt! Differential Revision: https://phabricator.services.mozilla.com/D31464
toolkit/xre/moz.build
toolkit/xre/nsEmbedFunctions.cpp
toolkit/xre/nsGDKErrorHandler.cpp
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -97,25 +97,21 @@ else:
     ]
 
 if CONFIG['MOZ_HAS_REMOTE']:
     LOCAL_INCLUDES += [
         '../components/remote',
     ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
-    UNIFIED_SOURCES += [
-        'nsGDKErrorHandler.cpp',
-    ]
+    SOURCES += ['nsGDKErrorHandler.cpp']
 
 if CONFIG['MOZ_X11']:
     EXPORTS += ['nsX11ErrorHandler.h']
-    UNIFIED_SOURCES += [
-        'nsX11ErrorHandler.cpp',
-    ]
+    SOURCES += ['nsX11ErrorHandler.cpp']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     UNIFIED_SOURCES += [
         'nsAndroidStartup.cpp',
     ]
 
 UNIFIED_SOURCES += [
     '/toolkit/mozapps/update/common/commonupdatedir.cpp',
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -43,18 +43,16 @@
 #endif
 #include "ThreadAnnotation.h"
 
 #include "mozilla/Omnijar.h"
 #if defined(XP_MACOSX)
 #  include "nsVersionComparator.h"
 #  include "chrome/common/mach_ipc_mac.h"
 #endif
-#include "nsX11ErrorHandler.h"
-#include "nsGDKErrorHandler.h"
 #include "base/at_exit.h"
 #include "base/command_line.h"
 #include "base/message_loop.h"
 #include "base/process_util.h"
 #include "chrome/common/child_process.h"
 #if defined(MOZ_WIDGET_ANDROID)
 #  include "chrome/common/ipc_channel.h"
 #  include "mozilla/jni/Utils.h"
@@ -999,16 +997,21 @@ bool XRE_ShutdownTestShell() {
     ret = gContentParent->DestroyTestShell(
         gContentParent->GetTestShellSingleton());
   }
   NS_RELEASE(gContentParent);
   return ret;
 }
 
 #ifdef MOZ_X11
+#  ifdef MOZ_WIDGET_GTK
+#    include "nsGDKErrorHandler.h"
+#  else
+#    include "nsX11ErrorHandler.h"
+#  endif
 void XRE_InstallX11ErrorHandler() {
 #  ifdef MOZ_WIDGET_GTK
   InstallGdkErrorHandler();
 #  else
   InstallX11ErrorHandler();
 #  endif
 }
 #endif
--- a/toolkit/xre/nsGDKErrorHandler.cpp
+++ b/toolkit/xre/nsGDKErrorHandler.cpp
@@ -9,17 +9,17 @@
 #include <gdk/gdkx.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
 
 #include "nsDebug.h"
 #include "nsString.h"
 #include "nsX11ErrorHandler.h"
-
+#include "X11UndefineNone.h"  // For X11True
 #include "prenv.h"
 
 /* See https://bugzilla.gnome.org/show_bug.cgi?id=629608#c8
  *
  * GDK implements X11 error traps to ignore X11 errors.
  * Unfortunatelly We don't know which X11 events can be ignored
  * so we have to utilize the Gdk error handler to avoid
  * false alarms in Gtk3.