summaryrefslogtreecommitdiff
path: root/emulators/gpsim-devel/patches/patch-ab
blob: bcca6d11a6e030ca7606718bc8db3dae1efdc27c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$NetBSD: patch-ab,v 1.5 2012/05/10 07:10:49 dholland Exp $

- Use standard headers.
- Honor constness of dlerror()'s return value on DragonFly.
- Fix build with latest glib2.

--- src/os_dependent.cc.orig	2005-08-03 18:01:01.000000000 +0000
+++ src/os_dependent.cc
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA.  */
 #include <stdlib.h>
 #include <unistd.h>
 #include <string>
+#include <string.h>
 
 #include <iostream>
 #include <iomanip>
@@ -37,14 +38,16 @@ Boston, MA 02111-1307, USA.  */
 #include "exports.h"
 #include "modules.h"
 
+#if defined(__DragonFly__)
+#include <glib.h>
+#endif
 #ifndef _WIN32
 #include <dlfcn.h>
 #define STRICMP strcasecmp
 #else
 #define G_PLATFORM_WIN32
 #define G_OS_WIN32
-#include <glib/gmem.h>
-#include <glib/gwin32.h>
+#include <glib.h>
 #include <direct.h>
 #include <windows.h>
 
@@ -348,7 +351,9 @@ unsigned long get_error() {
 }
 
 char * get_error_message() {
-#ifndef _WIN32
+#if defined(__DragonFly__)
+  return g_strdup(dlerror());
+#elif !defined(_WIN32)
   return dlerror();
 #else
   return g_win32_error_message(GetLastError());
@@ -357,7 +362,7 @@ char * get_error_message() {
 
 void free_error_message(char * pszError)
 {
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__DragonFly__)
   g_free(pszError);
 #endif
 }