diff --git a/src/emu.h b/src/emu.h index 2206f53..378da24 100644 --- a/src/emu.h +++ b/src/emu.h @@ -8,7 +8,7 @@ * * Main include file for the application. * - * Version: @(#)emu.h 1.0.32 2018/09/23 + * Version: @(#)emu.h 1.0.33 2018/10/03 * * Author: Fred N. van Kempen, * @@ -198,9 +198,14 @@ extern void set_screen_size_natural(void); extern const wchar_t *get_string(int id); extern uint32_t get_val(const char *str); + +#ifndef USE_STANDARD_MALLOC + extern void *mem_alloc(size_t sz); #define malloc mem_alloc +#endif + #ifdef __cplusplus } #endif diff --git a/src/misc.c b/src/misc.c index 726033b..7010534 100644 --- a/src/misc.c +++ b/src/misc.c @@ -8,7 +8,7 @@ * * Misc functions that do not fit anywhere else. * - * Version: @(#)misc.c 1.0.2 2018/09/22 + * Version: @(#)misc.c 1.0.3 2018/10/03 * * Author: Fred N. van Kempen, * @@ -88,6 +88,7 @@ get_val(const char *str) return(l); } +#ifndef USE_STANDARD_MALLOC /* Safe version of malloc(3) that catches NULL returns. */ void * @@ -110,3 +111,5 @@ mem_alloc(size_t sz) return(ptr); } + +#endif diff --git a/src/win/msvc/vc15/VARCem.vcxproj b/src/win/msvc/vc15/VARCem.vcxproj index 3454a7f..3f51d77 100644 --- a/src/win/msvc/vc15/VARCem.vcxproj +++ b/src/win/msvc/vc15/VARCem.vcxproj @@ -701,7 +701,7 @@ Level3 Disabled true - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;USE_STANDARD_MALLOC;%(PreprocessorDefinitions) Windows @@ -740,7 +740,7 @@ true true true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;USE_STANDARD_MALLOC;%(PreprocessorDefinitions) Windows