From 158cfab664aa2a959a6c55c0d53a15678d5ffb0b Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Thu, 21 Oct 2010 18:00:14 -0700 Subject: [PATCH] Fix calling conventions in malloc_ctl.h The Perl_malloc() etc. functions are *also* declared in proto.h, so the declarations need to match. The inclusion of malloc_ctl.h into perl.h had to be moved down until after the point where PERL_CALLCONV was completely defined. --- malloc_ctl.h | 10 ++++------ perl.h | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/malloc_ctl.h b/malloc_ctl.h index 7a6aed0..d746372 100644 --- a/malloc_ctl.h +++ b/malloc_ctl.h @@ -14,14 +14,12 @@ struct perl_mstats { }; typedef struct perl_mstats perl_mstats_t; -START_EXTERN_C -Malloc_t Perl_malloc (MEM_SIZE nbytes); -Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size); -Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes); +PERL_CALLCONV Malloc_t Perl_malloc (MEM_SIZE nbytes); +PERL_CALLCONV Malloc_t Perl_calloc (MEM_SIZE elements, MEM_SIZE size); +PERL_CALLCONV Malloc_t Perl_realloc (Malloc_t where, MEM_SIZE nbytes); /* 'mfree' rather than 'free', since there is already a 'perl_free' * that causes clashes with case-insensitive linkers */ -Free_t Perl_mfree (Malloc_t where); -END_EXTERN_C +PERL_CALLCONV Free_t Perl_mfree (Malloc_t where); #ifndef NO_MALLOC_DYNAMIC_CFG diff --git a/perl.h b/perl.h index ccdc078..41ea32e 100644 --- a/perl.h +++ b/perl.h @@ -2387,10 +2387,6 @@ int isnan(double d); #endif -#ifdef MYMALLOC -# include "malloc_ctl.h" -#endif - struct RExC_state_t; struct _reg_trie_data; @@ -4979,6 +4975,10 @@ struct tempsym; /* defined in pp_pack.c */ #define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o); #define PERL_PPDEF(s) PERL_CALLCONV OP *s (pTHX); +#ifdef MYMALLOC +# include "malloc_ctl.h" +#endif + #include "proto.h" /* this has structure inits, so it cannot be included before here */ -- 1.8.3.1