Deal with const-ness of dlerror()'s return value like gpsim-devel.

This commit is contained in:
joerg 2006-06-19 22:05:14 +00:00
parent 795c6004c1
commit eb175cf6cc
2 changed files with 37 additions and 1 deletions

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.7 2006/06/04 06:14:11 dogcow Exp $
$NetBSD: distinfo,v 1.8 2006/06/19 22:05:14 joerg Exp $
SHA1 (gpsim-0.21.11.tar.gz) = 05337560a6b48a9afb7a3f4be1ba606709f6b30a
RMD160 (gpsim-0.21.11.tar.gz) = 36001180948fc2394043d8283dc1dd028ee4f922
Size (gpsim-0.21.11.tar.gz) = 1218332 bytes
SHA1 (patch-aa) = 0d102952cb8dbe7faaf50416a2d9bec24683c300
SHA1 (patch-ab) = 199403ee700b145dcb44f42c258903903af20785

View file

@ -0,0 +1,35 @@
$NetBSD: patch-ab,v 1.5 2006/06/19 22:05:14 joerg Exp $
--- src/os_dependent.cc.orig 2005-08-25 21:57:41.000000000 +0000
+++ src/os_dependent.cc
@@ -37,6 +37,10 @@ Boston, MA 02111-1307, USA. */
#include "exports.h"
#include "modules.h"
+#if defined(__DragonFly__)
+#include <glib/gstrfuncs.h>
+#include <glib/gmem.h>
+#endif
#ifndef _WIN32
#include <dlfcn.h>
#define STRICMP strcasecmp
@@ -348,7 +352,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 +363,7 @@ char * get_error_message() {
void free_error_message(char * pszError)
{
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__DragonFly__)
g_free(pszError);
#endif
}