From 985d9637455929be5b19741de7ba47b245b0cab8 Mon Sep 17 00:00:00 2001 From: Kyryl Melekhin Date: Sun, 1 Nov 2020 15:24:45 +0000 Subject: [PATCH] tcc.h libtcc.c: remove unused defines pretty sure that functions with use_* do not exist and attempts to use the macros will fail to link I could rename them to be more up to date like tcc_malloc, but to me overloading the std calls with macros is probably taking away control from the programmer, so for the best is to just get rid of them. --- libtcc.c | 4 ---- tcc.h | 5 ----- 2 files changed, 9 deletions(-) diff --git a/libtcc.c b/libtcc.c index 36986328..6027b36e 100644 --- a/libtcc.c +++ b/libtcc.c @@ -421,10 +421,6 @@ PUB_FUNC void tcc_memcheck(void) } #endif /* MEM_DEBUG */ -#define free(p) use_tcc_free(p) -#define malloc(s) use_tcc_malloc(s) -#define realloc(p, s) use_tcc_realloc(p, s) - /********************************************************/ /* dynarrays */ diff --git a/tcc.h b/tcc.h index da385a3a..ec7860d7 100644 --- a/tcc.h +++ b/tcc.h @@ -1229,11 +1229,6 @@ PUB_FUNC void *tcc_realloc_debug(void *ptr, unsigned long size, const char *file PUB_FUNC char *tcc_strdup_debug(const char *str, const char *file, int line); #endif -#define free(p) use_tcc_free(p) -#define malloc(s) use_tcc_malloc(s) -#define realloc(p, s) use_tcc_realloc(p, s) -#undef strdup -#define strdup(s) use_tcc_strdup(s) PUB_FUNC void _tcc_error_noabort(const char *fmt, ...) PRINTF_LIKE(1,2); PUB_FUNC NORETURN void _tcc_error(const char *fmt, ...) PRINTF_LIKE(1,2); PUB_FUNC void _tcc_warning(const char *fmt, ...) PRINTF_LIKE(1,2);