aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.h
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2016-12-12 02:55:20 +0100
committerMatthias Andree <matthias.andree@gmx.de>2016-12-12 02:55:20 +0100
commita3c08a3c2eb026a582575dee047f13781d1d4d83 (patch)
tree8948755a6dd83085ab67c406bf6e4ee8bd38e535 /xmalloc.h
parent00772c13773cb20747fb7a1d590218cd46646b82 (diff)
parent0aeab1198903075c1e4d1cee5dda2322d22a7955 (diff)
downloadfetchmail-a3c08a3c2eb026a582575dee047f13781d1d4d83.tar.gz
fetchmail-a3c08a3c2eb026a582575dee047f13781d1d4d83.tar.bz2
fetchmail-a3c08a3c2eb026a582575dee047f13781d1d4d83.zip
Merge branch 'uidl-speedup-n-log-n-64' into legacy_64
Diffstat (limited to 'xmalloc.h')
-rw-r--r--xmalloc.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmalloc.h b/xmalloc.h
index 81835828..70ed0a0b 100644
--- a/xmalloc.h
+++ b/xmalloc.h
@@ -4,9 +4,14 @@
#define XMALLOC_H
#include "config.h"
+#include <stdlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* xmalloc.c */
-#if defined(HAVE_VOIDPOINTER)
+#if defined(HAVE_VOIDPOINTER) || defined(__cplusplus)
#define XMALLOCTYPE void
#else
#define XMALLOCTYPE char
@@ -16,7 +21,7 @@
XMALLOCTYPE *xmalloc(size_t n);
/** Reallocate \a n characters of memory, abort program on failure. */
-XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t n);
+XMALLOCTYPE *xrealloc(/*@null@*/ void *, size_t n);
/** Free memory at position \a p and set pointer \a p to NULL afterwards. */
#define xfree(p) { if (p) { free(p); } (p) = 0; }
@@ -31,4 +36,8 @@ char *xstrdup(const char *src);
* length including NUL byte or n + 1. */
char *xstrndup(const char *src, size_t n);
+#ifdef __cplusplus
+}
+#endif
+
#endif