Date: Mon, 14 Feb 2000 21:52:35 +0100 From: Teun Burgers Subject: Portability patch for DJGPP to glib-1.2.6 To: gtk-bugs AT gtk DOT org Cc: djgpp AT delorie DOT com Message-id: <38A86B13.F124845A@ecn.nl> X-Envelope-to: djgpp AT delorie DOT com MIME-version: 1.0 X-Mailer: Mozilla 4.7 [en] (Win98; I) Content-type: multipart/mixed; boundary="------------572BB163F854D51C81289A22" Content-transfer-encoding: 7BIT X-Accept-Language: en Reply-To: djgpp AT delorie DOT com This is a multi-part message in MIME format. --------------572BB163F854D51C81289A22 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi the attached patch makes glib-1.2.6 compile with the DJGPP port of gcc. (http://www.delorie.com/djgpp/). I use djgpp version 2.03 gcc 2.951 Windows 98, 2nd edition The patch adresses two problems: - djgpp does not have a functioning fork. - djgpp comes with pwd.h and a struct passwd. However struct passwd on DJGPP does not have a member pw->gecos. Files affected are gerror.c and gutils.c After applying this patch glib 1.2.6 compiles and passes all tests. kind regards Teun Burgers --------------572BB163F854D51C81289A22 Content-Type: text/plain; charset=us-ascii; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch.txt" diff -ru glib-1.2.6/gerror.c glibn126/gerror.c --- glib-1.2.6/gerror.c Mon Aug 23 19:41:20 1999 +++ glibn126/gerror.c Mon Feb 14 21:29:04 2000 @@ -148,7 +148,7 @@ void g_on_error_stack_trace (const gchar *prg_name) { -#ifndef NATIVE_WIN32 +#if !defined NATIVE_WIN32 && !defined DJGPP pid_t pid; gchar buf[16]; gchar *args[4] = { "gdb", NULL, NULL, NULL }; @@ -192,7 +192,7 @@ static void stack_trace (char **args) { -#ifndef NATIVE_WIN32 +#if !defined NATIVE_WIN32 && !defined DJGPP pid_t pid; int in_fd[2]; int out_fd[2]; diff -ru glib-1.2.6/gutils.c glibn126/gutils.c --- glib-1.2.6/gutils.c Tue May 11 02:30:06 1999 +++ glibn126/gutils.c Mon Feb 14 21:37:04 2000 @@ -521,7 +521,11 @@ if (pw) { g_user_name = g_strdup (pw->pw_name); +#ifdef DJGPP + g_real_name = g_strdup (pw->pw_name); +#else g_real_name = g_strdup (pw->pw_gecos); +#endif if (!g_home_dir) g_home_dir = g_strdup (pw->pw_dir); } --------------572BB163F854D51C81289A22--