From 7ee8501b188fbbee519f1704949093fcef99c010 Mon Sep 17 00:00:00 2001
From: Adrian Panasiuk
Date: Sun, 29 Mar 2009 05:04:00 +0000
Subject: [PATCH] * break glib-2.18.3-haiku.diff into a well-written part
(some) and a provisionally-written part (more); * some.diff: fncntl.h
included conditionally instead of not being included at all; * more.diff: the
chunks that made it into here regard Makefiles, interpreter path in perl
scripts and a couple of C functions which are disabled, but probably should
be implemented.
---
dev-libs/glib/glib-2.18.3-haiku-more.diff | 285 +++++++++++++++++++
dev-libs/glib/glib-2.18.3-haiku-some.diff | 323 ++++++++++++++++++++++
2 files changed, 608 insertions(+)
create mode 100644 dev-libs/glib/glib-2.18.3-haiku-more.diff
create mode 100644 dev-libs/glib/glib-2.18.3-haiku-some.diff
diff --git a/dev-libs/glib/glib-2.18.3-haiku-more.diff b/dev-libs/glib/glib-2.18.3-haiku-more.diff
new file mode 100644
index 000000000..1e373cb68
--- /dev/null
+++ b/dev-libs/glib/glib-2.18.3-haiku-more.diff
@@ -0,0 +1,285 @@
+diff -Naur glib-2.18.3-some/gio/Makefile.am glib-2.18.3-more/gio/Makefile.am
+--- glib-2.18.3-some/gio/Makefile.am 2009-03-29 05:36:04.000000000 +0000
++++ glib-2.18.3-more/gio/Makefile.am 2009-03-29 05:37:24.000000000 +0000
+@@ -162,7 +162,7 @@
+
+ endif
+
+-SUBDIRS += tests
++#SUBDIRS += tests
+
+ libgio_2_0_la_SOURCES = \
+ gappinfo.c \
+diff -Naur glib-2.18.3-some/gio/gunixinputstream.c glib-2.18.3-more/gio/gunixinputstream.c
+--- glib-2.18.3-some/gio/gunixinputstream.c 2009-03-29 05:36:05.000000000 +0000
++++ glib-2.18.3-more/gio/gunixinputstream.c 2009-03-29 05:37:24.000000000 +0000
+@@ -28,7 +28,9 @@
+ #include
+ #include
+ #include
++#ifdef HAVE_POLL
+ #include
++#endif
+
+ #include
+ #include
+@@ -171,6 +173,9 @@
+ GCancellable *cancellable,
+ GError **error)
+ {
++#if defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++ return -1;
++#else
+ GUnixInputStream *unix_stream;
+ gssize res;
+ struct pollfd poll_fds[2];
+@@ -226,6 +231,7 @@
+ }
+
+ return res;
++#endif
+ }
+
+ static gboolean
+@@ -331,6 +337,7 @@
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+ {
++#if !defined(G_OS_BEOS) &&!defined(G_OS_HAIKU)
+ GSource *source;
+ GUnixInputStream *unix_stream;
+ ReadAsyncData *data;
+@@ -353,6 +360,7 @@
+ g_source_attach (source, NULL);
+
+ g_source_unref (source);
++#endif
+ }
+
+ static gssize
+diff -Naur glib-2.18.3-some/gio/gunixmounts.c glib-2.18.3-more/gio/gunixmounts.c
+--- glib-2.18.3-some/gio/gunixmounts.c 2009-03-29 05:36:05.000000000 +0000
++++ glib-2.18.3-more/gio/gunixmounts.c 2009-03-29 05:37:25.000000000 +0000
+@@ -594,6 +594,16 @@
+
+ return g_list_reverse (return_list);
+ }
++
++#elif defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++
++static GList *
++_g_get_unix_mounts (void)
++{
++ GList *return_list = NULL;
++ return return_list;
++}
++
+ #else
+ #error No _g_get_unix_mounts() implementation for system
+ #endif
+@@ -974,6 +984,16 @@
+
+ return g_list_reverse (return_list);
+ }
++
++#elif defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++
++static GList *
++_g_get_unix_mount_points (void)
++{
++ GList *return_list = NULL;
++ return return_list;
++}
++
+ #else
+ #error No g_get_mount_table() implementation for system
+ #endif
+diff -Naur glib-2.18.3-some/gio/gunixoutputstream.c glib-2.18.3-more/gio/gunixoutputstream.c
+--- glib-2.18.3-some/gio/gunixoutputstream.c 2009-03-29 05:36:05.000000000 +0000
++++ glib-2.18.3-more/gio/gunixoutputstream.c 2009-03-29 05:37:25.000000000 +0000
+@@ -28,7 +28,9 @@
+ #include
+ #include
+ #include
++#ifdef HAVE_POLL
+ #include
++#endif
+
+ #include
+ #include
+@@ -159,6 +161,9 @@
+ GCancellable *cancellable,
+ GError **error)
+ {
++#if defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++ return -1;
++#else
+ GUnixOutputStream *unix_stream;
+ gssize res;
+ struct pollfd poll_fds[2];
+@@ -215,6 +220,7 @@
+ }
+
+ return res;
++#endif
+ }
+
+ static gboolean
+@@ -320,6 +326,7 @@
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+ {
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
+ GSource *source;
+ GUnixOutputStream *unix_stream;
+ WriteAsyncData *data;
+@@ -342,6 +349,7 @@
+ g_source_attach (source, NULL);
+
+ g_source_unref (source);
++#endif
+ }
+
+ static gssize
+diff -Naur glib-2.18.3-some/gio/makegioalias.pl glib-2.18.3-more/gio/makegioalias.pl
+--- glib-2.18.3-some/gio/makegioalias.pl 2009-03-29 05:36:05.000000000 +0000
++++ glib-2.18.3-more/gio/makegioalias.pl 2009-03-29 05:37:25.000000000 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl -w
++#!/boot/home/config/bin/perl -w
+
+ my $do_def = 0;
+
+diff -Naur glib-2.18.3-some/glib/Makefile.am glib-2.18.3-more/glib/Makefile.am
+--- glib-2.18.3-some/glib/Makefile.am 2009-03-29 05:36:06.000000000 +0000
++++ glib-2.18.3-more/glib/Makefile.am 2009-03-29 05:37:25.000000000 +0000
+@@ -19,7 +19,7 @@
+ gregex_h =
+ endif
+
+-SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre . tests
++SUBDIRS = libcharset $(PRINTF_SUBDIR) $(MAYBE_PCRE) update-pcre .
+
+ DIST_SUBDIRS = libcharset gnulib pcre update-pcre tests
+
+diff -Naur glib-2.18.3-some/glib/gbacktrace.c glib-2.18.3-more/glib/gbacktrace.c
+--- glib-2.18.3-some/glib/gbacktrace.c 2009-03-29 05:36:06.000000000 +0000
++++ glib-2.18.3-more/glib/gbacktrace.c 2009-03-29 05:37:25.000000000 +0000
+@@ -158,7 +158,7 @@
+ void
+ g_on_error_stack_trace (const gchar *prg_name)
+ {
+-#if defined(G_OS_UNIX) || defined(G_OS_BEOS)
++#if defined(G_OS_UNIX) || defined(G_OS_BEOS) || defined(G_OS_HAIKU)
+ pid_t pid;
+ gchar buf[16];
+ gchar *args[4] = { "gdb", NULL, NULL, NULL };
+@@ -193,7 +193,7 @@
+ #endif
+ }
+
+-#ifndef G_OS_WIN32
++#if !defined(G_OS_WIN32) && !defined(G_OS_BEOS)
+
+ static gboolean stack_trace_done = FALSE;
+
+diff -Naur glib-2.18.3-some/glib/gmain.c glib-2.18.3-more/glib/gmain.c
+--- glib-2.18.3-some/glib/gmain.c 2009-03-29 05:36:08.000000000 +0000
++++ glib-2.18.3-more/glib/gmain.c 2009-03-29 05:37:25.000000000 +0000
+@@ -82,6 +82,12 @@
+ #include
+ #endif /* G_OS_BEOS */
+
++#ifdef G_OS_HAIKU
++#include
++#include
++#include "fcntl.h"
++#endif /* G_OS_HAIKU */
++
+ #ifdef G_OS_UNIX
+ #include
+ #include
+@@ -569,6 +575,10 @@
+ #undef NO_FD_SET
+ #endif /* G_OS_BEOS */
+
++#ifdef G_OS_HAIKU
++#undef NO_FD_SET
++#endif /* G_OS_HAIKU */
++
+ #ifndef NO_FD_SET
+ # define SELECT_MASK fd_set
+ #else /* !NO_FD_SET */
+@@ -4022,6 +4032,7 @@
+ static void
+ g_child_watch_source_init_multi_threaded (void)
+ {
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
+ GError *error = NULL;
+ struct sigaction action;
+
+@@ -4041,6 +4052,7 @@
+ sigemptyset (&action.sa_mask);
+ action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
+ sigaction (SIGCHLD, &action, NULL);
++#endif
+ }
+
+ static void
+diff -Naur glib-2.18.3-some/glib/gspawn.c glib-2.18.3-more/glib/gspawn.c
+--- glib-2.18.3-some/glib/gspawn.c 2009-03-29 05:36:08.000000000 +0000
++++ glib-2.18.3-more/glib/gspawn.c 2009-03-29 05:37:25.000000000 +0000
+@@ -238,6 +238,9 @@
+ gint *exit_status,
+ GError **error)
+ {
++#if defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++ return FALSE;
++#else
+ gint outpipe = -1;
+ gint errpipe = -1;
+ GPid pid;
+@@ -433,6 +436,7 @@
+
+ return TRUE;
+ }
++#endif
+ }
+
+ /**
+@@ -908,7 +912,7 @@
+ gint fd;
+ gint res = 0;
+
+-#ifdef HAVE_SYS_RESOURCE_H
++#if defined(HAVE_SYS_RESOURCE_H) && !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
+ struct rlimit rl;
+ #endif
+
+@@ -951,7 +955,7 @@
+
+ #endif
+
+-#ifdef HAVE_SYS_RESOURCE_H
++#if defined(HAVE_SYS_RESOURCE_H) && !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
+
+ if (getrlimit(RLIMIT_NOFILE, &rl) == 0 && rl.rlim_max != RLIM_INFINITY)
+ open_max = rl.rlim_max;
+diff -Naur glib-2.18.3-some/glib/makegalias.pl glib-2.18.3-more/glib/makegalias.pl
+--- glib-2.18.3-some/glib/makegalias.pl 2009-03-29 05:36:09.000000000 +0000
++++ glib-2.18.3-more/glib/makegalias.pl 2009-03-29 05:37:25.000000000 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl -w
++#!/boot/home/config/bin/perl -w
+
+ my $do_def = 0;
+
+diff -Naur glib-2.18.3-some/gobject/makegobjectalias.pl glib-2.18.3-more/gobject/makegobjectalias.pl
+--- glib-2.18.3-some/gobject/makegobjectalias.pl 2009-03-29 05:36:09.000000000 +0000
++++ glib-2.18.3-more/gobject/makegobjectalias.pl 2009-03-29 05:37:25.000000000 +0000
+@@ -1,4 +1,4 @@
+-#!/usr/bin/perl -w
++#!/boot/home/config/bin/perl -w
+
+ my $do_def = 0;
+
diff --git a/dev-libs/glib/glib-2.18.3-haiku-some.diff b/dev-libs/glib/glib-2.18.3-haiku-some.diff
new file mode 100644
index 000000000..d510346c0
--- /dev/null
+++ b/dev-libs/glib/glib-2.18.3-haiku-some.diff
@@ -0,0 +1,323 @@
+diff -Naur glib-2.18.3-clean/configure.in glib-2.18.3-some/configure.in
+--- glib-2.18.3-clean/configure.in 2009-03-29 05:11:44.000000000 +0000
++++ glib-2.18.3-some/configure.in 2009-03-29 05:36:03.000000000 +0000
+@@ -112,6 +112,17 @@
+ esac
+ AC_MSG_RESULT([$glib_native_beos])
+
++AC_MSG_CHECKING([for Haiku])
++case $host in
++ *-*-haiku*)
++ glib_native_haiku="yes"
++ ;;
++ *)
++ glib_native_haiku="no"
++ ;;
++esac
++AC_MSG_RESULT([$glib_native_haiku])
++
+ dnl
+
+ AC_MSG_CHECKING([for Win32])
+@@ -3280,6 +3291,9 @@
+ #define G_PLATFORM_WIN32
+ #define G_WITH_CYGWIN"
+ ;;
++ *-*-haiku*)
++ glib_os="#define G_OS_HAIKU"
++ ;;
+ *-*-mingw*)
+ glib_os="#define G_OS_WIN32
+ #define G_PLATFORM_WIN32"
+diff -Naur glib-2.18.3-clean/docs/reference/glib/glib-overrides.txt glib-2.18.3-some/docs/reference/glib/glib-overrides.txt
+--- glib-2.18.3-clean/docs/reference/glib/glib-overrides.txt 2009-03-29 05:11:44.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/glib-overrides.txt 2009-03-29 05:36:03.000000000 +0000
+@@ -215,6 +215,11 @@
+ #define G_OS_BEOS
+
+
++
++G_OS_HAIKU
++#define G_OS_HAIKU
++
++
+ # g_ascii_isxxx
+
+
+diff -Naur glib-2.18.3-clean/docs/reference/glib/glib-sections.txt glib-2.18.3-some/docs/reference/glib/glib-sections.txt
+--- glib-2.18.3-clean/docs/reference/glib/glib-sections.txt 2009-03-29 05:11:44.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/glib-sections.txt 2009-03-29 05:36:03.000000000 +0000
+@@ -125,6 +125,7 @@
+
+ G_OS_WIN32
+ G_OS_BEOS
++G_OS_HAIKU
+ G_OS_UNIX
+
+
+diff -Naur glib-2.18.3-clean/docs/reference/glib/html/glib-Standard-Macros.html glib-2.18.3-some/docs/reference/glib/html/glib-Standard-Macros.html
+--- glib-2.18.3-clean/docs/reference/glib/html/glib-Standard-Macros.html 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/html/glib-Standard-Macros.html 2009-03-29 05:36:04.000000000 +0000
+@@ -60,6 +60,7 @@
+
+ #define G_OS_WIN32
+ #define G_OS_BEOS
++#define G_OS_HAIKU
+ #define G_OS_UNIX
+
+ #define G_DIR_SEPARATOR
+@@ -115,6 +116,15 @@
+ BeOS-specific code in "#ifdef G_OS_BEOS".
+
+
++
++
G_OS_HAIKU
++
#define G_OS_HAIKU
++
++
++This macro is defined only on Haiku. So you can bracket
++Haiku-specific code in "#ifdef G_OS_HAIKU".
++
++
+
+
+
G_OS_UNIX
+diff -Naur glib-2.18.3-clean/docs/reference/glib/html/glib.devhelp glib-2.18.3-some/docs/reference/glib/html/glib.devhelp
+--- glib-2.18.3-clean/docs/reference/glib/html/glib.devhelp 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/html/glib.devhelp 2009-03-29 05:36:04.000000000 +0000
+@@ -189,6 +189,7 @@
+
+
+
++
+
+
+
+diff -Naur glib-2.18.3-clean/docs/reference/glib/html/glib.devhelp2 glib-2.18.3-some/docs/reference/glib/html/glib.devhelp2
+--- glib-2.18.3-clean/docs/reference/glib/html/glib.devhelp2 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/html/glib.devhelp2 2009-03-29 05:36:04.000000000 +0000
+@@ -189,6 +189,7 @@
+
+
+
++
+
+
+
+diff -Naur glib-2.18.3-clean/docs/reference/glib/html/ix01.html glib-2.18.3-some/docs/reference/glib/html/ix01.html
+--- glib-2.18.3-clean/docs/reference/glib/html/ix01.html 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/html/ix01.html 2009-03-29 05:36:04.000000000 +0000
+@@ -2260,6 +2260,8 @@
+
+
G_OS_BEOS, G_OS_BEOS
+
++
G_OS_HAIKU, G_OS_HAIKU
++
+
G_OS_UNIX, G_OS_UNIX
+
+
G_OS_WIN32, G_OS_WIN32
+diff -Naur glib-2.18.3-clean/docs/reference/glib/tmpl/macros.sgml glib-2.18.3-some/docs/reference/glib/tmpl/macros.sgml
+--- glib-2.18.3-clean/docs/reference/glib/tmpl/macros.sgml 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/tmpl/macros.sgml 2009-03-29 05:36:04.000000000 +0000
+@@ -33,6 +33,14 @@
+
+
+
++
++
++This macro is defined only on Haiku. So you can bracket
++Haiku-specific code in "#ifdef G_OS_HAIKU".
++
++
++
++
+
+
+ This macro is defined only on UNIX. So you can bracket
+diff -Naur glib-2.18.3-clean/docs/reference/glib/xml/api-index-full.xml glib-2.18.3-some/docs/reference/glib/xml/api-index-full.xml
+--- glib-2.18.3-clean/docs/reference/glib/xml/api-index-full.xml 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/xml/api-index-full.xml 2009-03-29 05:36:04.000000000 +0000
+@@ -1107,6 +1107,7 @@
+ g_option_group_set_translation_domain
+ G_OPTION_REMAINING
+ G_OS_BEOS
++G_OS_HAIKU
+ G_OS_UNIX
+ G_OS_WIN32
+ g_parse_debug_string
+diff -Naur glib-2.18.3-clean/docs/reference/glib/xml/macros.xml glib-2.18.3-some/docs/reference/glib/xml/macros.xml
+--- glib-2.18.3-clean/docs/reference/glib/xml/macros.xml 2009-03-29 05:11:45.000000000 +0000
++++ glib-2.18.3-some/docs/reference/glib/xml/macros.xml 2009-03-29 05:36:04.000000000 +0000
+@@ -19,6 +19,7 @@
+
+ #define G_OS_WIN32
+ #define G_OS_BEOS
++#define G_OS_HAIKU
+ #define G_OS_UNIX
+
+ #define G_DIR_SEPARATOR
+@@ -81,6 +82,14 @@
+ This macro is defined only on BeOS. So you can bracket
+ BeOS-specific code in "#ifdef G_OS_BEOS".
+
++
++G_OS_HAIKU
++G_OS_HAIKU#define G_OS_HAIKU
++
++
++This macro is defined only on Haiku. So you can bracket
++Haiku-specific code in "#ifdef G_OS_HAIKU".
++
+
+ G_OS_UNIX
+ G_OS_UNIX#define G_OS_UNIX
+diff -Naur glib-2.18.3-clean/gio/xdgmime/xdgmimealias.c glib-2.18.3-some/gio/xdgmime/xdgmimealias.c
+--- glib-2.18.3-clean/gio/xdgmime/xdgmimealias.c 2009-03-29 05:11:46.000000000 +0000
++++ glib-2.18.3-some/gio/xdgmime/xdgmimealias.c 2009-03-29 05:40:01.000000000 +0000
+@@ -35,7 +35,10 @@
+ #include
+ #include
+ #include
+-#include
++
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
++# include
++#endif
+
+ #ifndef FALSE
+ #define FALSE (0)
+diff -Naur glib-2.18.3-clean/gio/xdgmime/xdgmimecache.c glib-2.18.3-some/gio/xdgmime/xdgmimecache.c
+--- glib-2.18.3-clean/gio/xdgmime/xdgmimecache.c 2009-03-29 05:11:46.000000000 +0000
++++ glib-2.18.3-some/gio/xdgmime/xdgmimecache.c 2009-03-29 05:40:41.000000000 +0000
+@@ -34,7 +34,11 @@
+
+ #include
+ #include
+-#include
++
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
++# include
++#endif
++
+ #include
+
+ #include /* for ntohl/ntohs */
+diff -Naur glib-2.18.3-clean/gio/xdgmime/xdgmimeglob.c glib-2.18.3-some/gio/xdgmime/xdgmimeglob.c
+--- glib-2.18.3-clean/gio/xdgmime/xdgmimeglob.c 2009-03-29 05:11:46.000000000 +0000
++++ glib-2.18.3-some/gio/xdgmime/xdgmimeglob.c 2009-03-29 05:41:11.000000000 +0000
+@@ -35,7 +35,10 @@
+ #include
+ #include
+ #include
+-#include
++
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
++# include
++#endif
+
+ #ifndef FALSE
+ #define FALSE (0)
+diff -Naur glib-2.18.3-clean/gio/xdgmime/xdgmimeparent.c glib-2.18.3-some/gio/xdgmime/xdgmimeparent.c
+--- glib-2.18.3-clean/gio/xdgmime/xdgmimeparent.c 2009-03-29 05:11:46.000000000 +0000
++++ glib-2.18.3-some/gio/xdgmime/xdgmimeparent.c 2009-03-29 05:41:22.000000000 +0000
+@@ -35,7 +35,10 @@
+ #include
+ #include
+ #include
+-#include
++
++#if !defined(G_OS_BEOS) && !defined(G_OS_HAIKU)
++# include
++#endif
+
+ #ifndef FALSE
+ #define FALSE (0)
+diff -Naur glib-2.18.3-clean/glib/gslice.c glib-2.18.3-some/glib/gslice.c
+--- glib-2.18.3-clean/glib/gslice.c 2009-03-29 05:11:52.000000000 +0000
++++ glib-2.18.3-some/glib/gslice.c 2009-03-29 05:36:08.000000000 +0000
+@@ -302,6 +302,8 @@
+ GetSystemInfo (&system_info);
+ sys_page_size = system_info.dwPageSize;
+ }
++#elif defined(G_OS_BEOS)
++ sys_page_size = 4096;
+ #else
+ sys_page_size = sysconf (_SC_PAGESIZE); /* = sysconf (_SC_PAGE_SIZE); = getpagesize(); */
+ #endif
+diff -Naur glib-2.18.3-clean/glib/gstdio.c glib-2.18.3-some/glib/gstdio.c
+--- glib-2.18.3-clean/glib/gstdio.c 2009-03-29 05:11:52.000000000 +0000
++++ glib-2.18.3-some/glib/gstdio.c 2009-03-29 05:36:08.000000000 +0000
+@@ -47,7 +47,7 @@
+
+ #include "galias.h"
+
+-#if !defined (G_OS_UNIX) && !defined (G_OS_WIN32) && !defined (G_OS_BEOS)
++#if !defined (G_OS_UNIX) && !defined (G_OS_WIN32) && !defined (G_OS_BEOS) && !defined(G_OS_HAIKU)
+ #error Please port this to your operating system
+ #endif
+
+diff -Naur glib-2.18.3-clean/glib/gstrfuncs.c glib-2.18.3-some/glib/gstrfuncs.c
+--- glib-2.18.3-clean/glib/gstrfuncs.c 2009-03-29 05:11:52.000000000 +0000
++++ glib-2.18.3-some/glib/gstrfuncs.c 2009-03-29 05:36:08.000000000 +0000
+@@ -1328,7 +1328,7 @@
+ #ifdef HAVE_STRSIGNAL
+ const char *msg_locale;
+
+-#if defined(G_OS_BEOS) || defined(G_WITH_CYGWIN)
++#if defined(G_OS_BEOS) || defined(G_OS_HAIKU) || defined(G_WITH_CYGWIN)
+ extern const char *strsignal(int);
+ #else
+ /* this is declared differently (const) in string.h on BeOS */
+diff -Naur glib-2.18.3-clean/glib/gtester.c glib-2.18.3-some/glib/gtester.c
+--- glib-2.18.3-clean/glib/gtester.c 2009-03-29 05:11:52.000000000 +0000
++++ glib-2.18.3-some/glib/gtester.c 2009-03-29 05:36:08.000000000 +0000
+@@ -630,6 +630,7 @@
+ * we must fiddle with sigaction() *before* glib is used, otherwise
+ * we could revoke signal hanmdler setups from glib initialization code.
+ */
++#ifdef SA_RESTART
+ if (TRUE)
+ {
+ struct sigaction sa;
+@@ -639,6 +640,7 @@
+ sa.sa_flags = SA_RESTART;
+ sigaction (SIGCHLD, &sa, &osa);
+ }
++#endif
+
+ g_set_prgname (argv[0]);
+ parse_args (&argc, &argv);
+diff -Naur glib-2.18.3-clean/glib/gutils.c glib-2.18.3-some/glib/gutils.c
+--- glib-2.18.3-clean/glib/gutils.c 2009-03-29 05:11:52.000000000 +0000
++++ glib-2.18.3-some/glib/gutils.c 2009-03-29 05:36:08.000000000 +0000
+@@ -458,7 +458,7 @@
+ }
+
+ path = g_getenv ("PATH");
+-#if defined(G_OS_UNIX) || defined(G_OS_BEOS)
++#if defined(G_OS_UNIX) || defined(G_OS_BEOS) || defined(G_OS_HAIKU)
+ if (path == NULL)
+ {
+ /* There is no `PATH' in the environment. The default
+@@ -2279,6 +2279,21 @@
+ }
+ #endif /* G_OS_WIN32 */
+
++#if defined(G_OS_BEOS) || defined(G_OS_HAIKU)
++static void
++load_user_special_dirs (void)
++{
++ g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = g_strdup("$HOME/Desktop");
++ g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = g_strdup("$HOME");
++ g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = g_strdup("$HOME/Desktop");
++ g_user_special_dirs[G_USER_DIRECTORY_MUSIC] = NULL;
++ g_user_special_dirs[G_USER_DIRECTORY_PICTURES] = NULL;
++ g_user_special_dirs[G_USER_DIRECTORY_PUBLIC_SHARE] = NULL;
++ g_user_special_dirs[G_USER_DIRECTORY_TEMPLATES] = NULL;
++ g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = NULL;
++}
++#endif /* G_OS_BEOS */
++
+ static void g_init_user_config_dir (void);
+
+ #if defined(G_OS_UNIX) && !defined(HAVE_CARBON)