pkgsrc-wip/dmd/patches/patch-as

30 lines
1.2 KiB
Plaintext

$NetBSD: patch-as,v 1.1.1.1 2011/02/16 17:10:41 thomasklausner Exp $
--- src/dmd/inifile.c.orig 2010-12-20 20:02:36.000000000 +0000
+++ src/dmd/inifile.c
@@ -23,7 +23,7 @@
#include <sys/syslimits.h>
#endif
-#if __FreeBSD__ || __sun&&__SVR4
+#if __FreeBSD__ || __sun&&__SVR4 || __NetBSD__
// for PATH_MAX
#include <limits.h>
#endif
@@ -111,12 +111,12 @@ const char *inifile(const char *argv0x,
filename = (char *)FileName::replaceName(argv0, inifile);
if (!FileName::exists(filename))
{
-#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4
-#if __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun&&__SVR4 // This fix by Thomas Kuehne
+#if linux || __APPLE__ || __FreeBSD__ || __sun&&__SVR4 || __NetBSD__
+#if __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun&&__SVR4 || __NetBSD__ // This fix by Thomas Kuehne
/* argv0 might be a symbolic link,
* so try again looking past it to the real path
*/
-#if __APPLE__ || __FreeBSD__ || __sun&&__SVR4
+#if __APPLE__ || __FreeBSD__ || __sun&&__SVR4 || __NetBSD__
char resolved_name[PATH_MAX + 1];
char* real_argv0 = realpath(argv0, resolved_name);
#else