summaryrefslogtreecommitdiff
path: root/sysutils/amanda-common/patches/patch-ah
blob: 3b43ab5dc868ffc8ce42890b2788de9730793082 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$NetBSD: patch-ah,v 1.1 2008/03/08 01:10:27 gdt Exp $

Work around a problem linking to _environ in Mac OS X.

--- common-src/alloc.c.orig	2007-05-07 16:46:45.000000000 -0400
+++ common-src/alloc.c
@@ -37,6 +37,11 @@
 #define MIN_ALLOC 64
 static char *internal_vstralloc(const char *, va_list);
 
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (* _NSGetEnviron())
+#endif
+
 /*
  *=====================================================================
  * debug_caller_loc -- keep track of all allocation callers