2012-05-10 09:10:49 +02:00
|
|
|
$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.
|
2006-04-28 17:33:28 +02:00
|
|
|
|
2011-12-19 16:58:40 +01:00
|
|
|
--- src/os_dependent.cc.orig 2005-08-03 18:01:01.000000000 +0000
|
2006-04-28 17:33:28 +02:00
|
|
|
+++ src/os_dependent.cc
|
2011-12-19 16:58:40 +01:00
|
|
|
@@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string>
|
|
|
|
+#include <string.h>
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <iomanip>
|
2012-05-10 09:10:49 +02:00
|
|
|
@@ -37,14 +38,16 @@ Boston, MA 02111-1307, USA. */
|
2006-04-28 17:33:28 +02:00
|
|
|
#include "exports.h"
|
|
|
|
#include "modules.h"
|
|
|
|
|
|
|
|
+#if defined(__DragonFly__)
|
2012-05-10 09:10:49 +02:00
|
|
|
+#include <glib.h>
|
2006-04-28 17:33:28 +02:00
|
|
|
+#endif
|
|
|
|
#ifndef _WIN32
|
|
|
|
#include <dlfcn.h>
|
|
|
|
#define STRICMP strcasecmp
|
2012-05-10 09:10:49 +02:00
|
|
|
#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() {
|
2006-04-28 17:33:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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());
|
2012-05-10 09:10:49 +02:00
|
|
|
@@ -357,7 +362,7 @@ char * get_error_message() {
|
2006-04-28 17:33:28 +02:00
|
|
|
|
|
|
|
void free_error_message(char * pszError)
|
|
|
|
{
|
|
|
|
-#ifdef _WIN32
|
|
|
|
+#if defined(_WIN32) || defined(__DragonFly__)
|
|
|
|
g_free(pszError);
|
|
|
|
#endif
|
|
|
|
}
|