summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-09-09 21:27:44 -0500
committerCraig A. Berry <craigberry@mac.com>2012-09-09 21:27:44 -0500
commit86f11a3d4085bbaf2b72fce18f55bd5a0cfc46d3 (patch)
treee436c71d2da5815b71e82adee7990c80a437f0cc /ext
parent7cd83f6573da7fd1101fc83cb13867d52fea3d41 (diff)
downloadperl-86f11a3d4085bbaf2b72fce18f55bd5a0cfc46d3.tar.gz
Fix C++, MYMALLOC, sdbm combination.
The prototypes for the home-grown malloc replacements were not protected with extern "C" declarations, so linking the SDBM_File extension failed when configuring with -Dusemymalloc=y and building with C++.
Diffstat (limited to 'ext')
-rw-r--r--ext/SDBM_File/sdbm/sdbm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/SDBM_File/sdbm/sdbm.h b/ext/SDBM_File/sdbm/sdbm.h
index 2b8d0e9463..2ada7a18ca 100644
--- a/ext/SDBM_File/sdbm/sdbm.h
+++ b/ext/SDBM_File/sdbm/sdbm.h
@@ -179,10 +179,19 @@ extern long sdbm_hash proto((const char *, int));
# define realloc Perl_realloc
# define free Perl_mfree
+#ifdef __cplusplus
+extern "C" {
+#endif
+
Malloc_t Perl_malloc proto((MEM_SIZE nbytes));
Malloc_t Perl_calloc proto((MEM_SIZE elements, MEM_SIZE size));
Malloc_t Perl_realloc proto((Malloc_t where, MEM_SIZE nbytes));
Free_t Perl_mfree proto((Malloc_t where));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* MYMALLOC */
#ifdef I_STRING