[Libguestfs] [PATCH 10/10] Mac OS X: Fix HAVE_GNU_CALLOC so it works when __GLIBC__ is not defined.

Richard W.M. Jones rjones at redhat.com
Sun Mar 21 17:26:39 UTC 2010


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
-------------- next part --------------
>From 13c0c9c47df55e86363821deeb1f5d78cb38ea86 Mon Sep 17 00:00:00 2001
From: Richard Jones <rich at koneko.home.annexia.org>
Date: Sun, 21 Mar 2010 17:16:04 +0000
Subject: [PATCH 10/10] Mac OS X: Fix HAVE_GNU_CALLOC so it works when __GLIBC__ is not defined.

---
 src/guestfs.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/guestfs.c b/src/guestfs.c
index 01642b4..61e9302 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -439,7 +439,11 @@ guestfs_safe_malloc (guestfs_h *g, size_t nbytes)
 
 /* Technically we should add an autoconf test for this, testing for the desired
    functionality, like what's done in gnulib, but for now, this is fine.  */
+#if defined(__GLIBC__)
 #define HAVE_GNU_CALLOC (__GLIBC__ >= 2)
+#else
+#define HAVE_GNU_CALLOC 0
+#endif
 
 /* Allocate zeroed memory for N elements of S bytes, with error
    checking.  S must be nonzero.  */
-- 
1.6.4.1



More information about the Libguestfs mailing list