Fix includes and add glib version check.
authordbaron@dbaron.org
Wed, 23 May 2007 09:13:22 -0700
changeset 1781 9ce61ca40d2d4bb2b6866037b384b47ee19733f3
parent 1780 fe4f5574a025816d77c4800670254e1ecb50f144
child 1782 4650da9584feb645ebc880ca7af8b51f4e678604
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9a5pre
Fix includes and add glib version check.
xpfe/bootstrap/nsSigHandlers.cpp
--- a/xpfe/bootstrap/nsSigHandlers.cpp
+++ b/xpfe/bootstrap/nsSigHandlers.cpp
@@ -39,19 +39,21 @@
 
 /*
  * This module is supposed to abstract signal handling away from the other
  * platforms that do not support it.
  */
 
 #include <signal.h>
 #include <stdio.h>
+#include <string.h>
 #include "prthread.h"
 #include "plstr.h"
 #include "prenv.h"
+#include "nsDebug.h"
 
 #if defined(LINUX)
 #include <sys/time.h>
 #include <sys/resource.h>
 #include <unistd.h>
 #include <stdlib.h> // atoi
 #endif
 
@@ -65,17 +67,16 @@
 #include "nsCOMPtr.h"
 #include "nsIServiceManager.h"
 #include "nsIAppStartup.h"
 #include "nsXPFEComponentsCID.h"
 #endif
 
 #ifdef MOZ_WIDGET_PHOTON
 #include <photon/PhProto.h>
-#include <string.h>
 #endif
 
 static char _progname[1024] = "huh?";
 static unsigned int _gdb_sleep_duration = 300;
 
 #if defined(LINUX) && defined(DEBUG) && \
       (defined(__i386) || defined(__x86_64) || defined(PPC))
 #define CRAWL_STACK_ON_SIGSEGV
@@ -152,17 +153,17 @@ void beos_signal_handler(int signum) {
 		exit(13);
 	}
 
 	// Exit the appshell so that the app can shutdown normally
 	appStartup->Quit(nsIAppStartup::eAttemptQuit);
 }
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK2 && GLIB_CHECK_VERSION(2,6,0)
 
 #include <glib.h>
 
 static GLogFunc orig_log_func = NULL;
 
 extern "C" {
 static void
 my_glib_log_func(const gchar *log_domain, GLogLevelFlags log_level,
@@ -249,17 +250,17 @@ void InstallUnixSignalHandlers(const cha
 	    }
     }
 #endif //SOLARIS
 
 #ifdef XP_BEOS
 	signal(SIGTERM, beos_signal_handler);
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK2 && GLIB_CHECK_VERSION(2,6,0)
   const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK");
   if (assertString &&
       (!strcmp(assertString, "suspend") ||
        !strcmp(assertString, "stack") ||
        !strcmp(assertString, "abort") ||
        !strcmp(assertString, "trap") ||
        !strcmp(assertString, "break"))) {
     // Override the default glib logging function so we get stacks for it too.