Add extern "C" for C++.
[gnulib.git] / lib / xalloc.h
index 4b65858..5985892 100644 (file)
@@ -1,7 +1,7 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
    Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2003, 2004 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 # include <stddef.h>
 
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+
 # ifndef __attribute__
 #  if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
 #   define __attribute__(x)
@@ -32,6 +38,7 @@
 #  define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
 # endif
 
+
 /* If this pointer is non-zero, run the specified function upon each
    allocation failure.  It is initialized to zero. */
 extern void (*xalloc_fail_func) (void);
@@ -84,4 +91,10 @@ char *xstrdup (const char *str);
 # define XREALLOC(p, type, n) xnrealloc (p, n, sizeof (type))
 # define XFREE(p) free (p)
 
+
+# ifdef __cplusplus
+}
+# endif
+
+
 #endif /* !XALLOC_H_ */