From b32733daaa8fdbbb2c6645b66d17d2778635ee72 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Thu, 5 Jan 2006 19:33:12 +0000 Subject: [PATCH] fix compile on darwin --- src/os/darwin/darwin_sigar.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 5dd477cd..97b90c4a 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -40,10 +40,12 @@ #define NMIB(mib) (sizeof(mib)/sizeof(mib[0])) -#if defined (__FreeBSD__) && (__FreeBSD_version >= 500013) -#define SIGAR_FREEBSD5 -#else -#define SIGAR_FREEBSD4 +#ifdef __FreeBSD__ +# if (__FreeBSD_version >= 500013) +# define SIGAR_FREEBSD5 +# else +# define SIGAR_FREEBSD4 +# endif #endif #ifdef SIGAR_FREEBSD5 @@ -197,9 +199,11 @@ int sigar_os_close(sigar_t *sigar) if (sigar->pinfo) { free(sigar->pinfo); } +#ifndef DARWIN if (sigar->kmem) { kvm_close(sigar->kmem); } +#endif free(sigar); return SIGAR_OK; }