From 36aa13da6c202b354537c08fa909f7bf122b420f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 23 Apr 2014 01:28:32 +0400 Subject: Fix MS VC redefinition warning for functions declared with GC_ATTR_MALLOC * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page, GC_debug_malloc_atomic_ignore_off_page, GC_debug_malloc_stubborn, GC_debug_malloc_atomic, GC_debug_strdup, GC_debug_strndup, GC_debug_wcsdup, GC_debug_malloc_uncollectable, GC_debug_malloc_atomic_uncollectable, GC_debug_generic_or_special_malloc, GC_debug_malloc_replacement): Add GC_ATTR_MALLOC attribute to API function definition (to avoid MS VC warning about redefinition of a symbol previously declared with __declspec). * fnlz_mlc.c (GC_finalized_malloc): Likewise. * gcj_mlc.c (GC_gcj_malloc, GC_debug_gcj_malloc, GC_gcj_malloc_ignore_off_page): Likewise. * malloc.c (GC_generic_malloc, GC_malloc_atomic, GC_malloc, GC_malloc_uncollectable): Likewise. * mallocx.c (GC_generic_or_special_malloc, GC_generic_malloc_ignore_off_page, GC_malloc_ignore_off_page, GC_malloc_atomic_ignore_off_page, GC_malloc_many, GC_memalign, GC_malloc_atomic_uncollectable, GC_strdup, GC_strndup, GC_wcsdup): Likewise. * stubborn.c (GC_malloc_stubborn): Likewise. * thread_local_alloc.c (GC_malloc, GC_malloc_atomic, GC_gcj_malloc): Likewise. * typd_mlc.c (GC_malloc_explicitly_typed, GC_malloc_explicitly_typed_ignore_off_page, GC_calloc_explicitly_typed): Likewise. --- malloc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'malloc.c') diff --git a/malloc.c b/malloc.c index 58aa55ab..a4dd437f 100644 --- a/malloc.c +++ b/malloc.c @@ -167,7 +167,7 @@ GC_INNER void * GC_generic_malloc_inner_ignore_off_page(size_t lb, int k) size_t GC_dbg_collect_at_malloc_min_lb = (GC_COLLECT_AT_MALLOC); #endif -GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) +GC_API GC_ATTR_MALLOC void * GC_CALL GC_generic_malloc(size_t lb, int k) { void * result; DCL_LOCK_STATE; @@ -225,7 +225,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) #ifdef THREAD_LOCAL_ALLOC GC_INNER void * GC_core_malloc_atomic(size_t lb) #else - GC_API void * GC_CALL GC_malloc_atomic(size_t lb) + GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_atomic(size_t lb) #endif { void *op; @@ -254,7 +254,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) #ifdef THREAD_LOCAL_ALLOC GC_INNER void * GC_core_malloc(size_t lb) #else - GC_API void * GC_CALL GC_malloc(size_t lb) + GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc(size_t lb) #endif { void *op; @@ -286,7 +286,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) } /* Allocate lb bytes of pointerful, traced, but not collectible data. */ -GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb) +GC_API GC_ATTR_MALLOC void * GC_CALL GC_malloc_uncollectable(size_t lb) { void *op; size_t lg; -- cgit v1.2.1