From: Marcus Holland-Moritz Date: Sun, 26 Oct 2008 20:54:43 +0000 (+0000) Subject: Make sure Perl_mem_log_(?:alloc|realloc|free) have C linkage, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=12754f92d4030382428f3ea50316b5f5ec03b315;p=p5sagit%2Fp5-mst-13.2.git Make sure Perl_mem_log_(?:alloc|realloc|free) have C linkage, so modules like Digest::MD5, that are including perl.h from within an 'extern "C"' block, will actually see them when building with a C++ compiler. Also make sure that Perl_mem_log_(?:new|del)_sv are only seen by sv.c. p4raw-id: //depot/perl@34598 --- diff --git a/handy.h b/handy.h index ca80375..d51b75d 100644 --- a/handy.h +++ b/handy.h @@ -762,11 +762,11 @@ PoisonWith(0xEF) for catching access to freed memory. * any News() happening...? */ -Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_EXPORT_C Malloc_t Perl_mem_log_alloc(const UV n, const UV typesize, const char *type_name, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); +PERL_EXPORT_C Malloc_t Perl_mem_log_realloc(const UV n, const UV typesize, const char *type_name, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname); -Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); +PERL_EXPORT_C Malloc_t Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname); # ifdef PERL_CORE # ifdef PERL_MEM_LOG_STDERR @@ -778,9 +778,10 @@ enum mem_log_type { MLT_DEL_SV }; # endif -/* those are only used in sv.c */ +# if defined(PERL_IN_SV_C) /* those are only used in sv.c */ void Perl_mem_log_new_sv(const SV *sv, const char *filename, const int linenumber, const char *funcname); void Perl_mem_log_del_sv(const SV *sv, const char *filename, const int linenumber, const char *funcname); +# endif # endif #endif