From 0313756ea38d71cfce21a0a905f4fc43ac68d197 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 27 Nov 2015 10:15:46 +1000 Subject: Add ability to emulate malloc() and free() to prevent nasty hard to find link errors from C library routines that need malloc --- src/gos/gos_rules.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gos/gos_rules.h') diff --git a/src/gos/gos_rules.h b/src/gos/gos_rules.h index 0f0f6596..de30befe 100644 --- a/src/gos/gos_rules.h +++ b/src/gos/gos_rules.h @@ -32,5 +32,16 @@ #error "GOS: GFX_FREERTOS_USE_TRACE is only available for the FreeRTOS port." #endif +#if GFX_EMULATE_MALLOC + #if GFX_USE_OS_WIN32 || GFX_USE_OS_LINUX || GFX_USE_OS_OSX || GFX_USE_OS_ECOS || \ + (GFX_OS_HEAP_SIZE == 0 && (GFX_USE_OS_RAW32 || GFX_USE_OS_ARDUINO || GFX_USE_OS_CMSIS || GFX_USE_OS_KEIL)) + #if GFX_DISPLAY_RULE_WARNINGS + #warning "GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform" + #endif + #undef GFX_EMULATE_MALLOC + #define GFX_EMULATE_MALLOC FALSE + #endif +#endif + #endif /* _GOS_RULES_H */ /** @} */ -- cgit v1.2.3