summaryrefslogtreecommitdiffstats
path: root/gnulib-local/lib/xalloc.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2006-10-31 12:41:52 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:14:17 +0200
commit93f012e908818e29a94125315409f3367997a2fd (patch)
tree7603af64e5d971cff109a7b3704f889017623512 /gnulib-local/lib/xalloc.h
parent58197c3268a119eb48bcd1ec0363f7b94f804a24 (diff)
downloadexternal_gettext-93f012e908818e29a94125315409f3367997a2fd.zip
external_gettext-93f012e908818e29a94125315409f3367997a2fd.tar.gz
external_gettext-93f012e908818e29a94125315409f3367997a2fd.tar.bz2
Make it compile in C++ mode.
Diffstat (limited to 'gnulib-local/lib/xalloc.h')
-rw-r--r--gnulib-local/lib/xalloc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnulib-local/lib/xalloc.h b/gnulib-local/lib/xalloc.h
index de230eb..a12c984 100644
--- a/gnulib-local/lib/xalloc.h
+++ b/gnulib-local/lib/xalloc.h
@@ -43,6 +43,15 @@ extern void *xcalloc (size_t nmemb, size_t size);
/* Change the size of an allocated block of memory PTR to SIZE bytes,
with error checking. If PTR is NULL, run xmalloc. */
extern void *xrealloc (void *ptr, size_t size);
+#ifdef __cplusplus
+}
+template <typename T>
+ inline T * xrealloc (T * ptr, size_t size)
+ {
+ return (T *) xrealloc((void *) ptr, size);
+ }
+extern "C" {
+#endif
/* This function is always triggered when memory is exhausted. It is
in charge of honoring the three previous items. This is the