diff options
author | inmarket <andrewh@inmarket.com.au> | 2015-11-27 10:15:46 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2015-11-27 10:15:46 +1000 |
commit | 0313756ea38d71cfce21a0a905f4fc43ac68d197 (patch) | |
tree | 035235b019041b5f75a64ab95a93ff8f7d027cb2 /src/gos/gos_rules.h | |
parent | 3681542e242bc6170b5c98aaa52a6df9ad21cae3 (diff) | |
download | uGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.tar.gz uGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.tar.bz2 uGFX-0313756ea38d71cfce21a0a905f4fc43ac68d197.zip |
Add ability to emulate malloc() and free() to prevent nasty hard to find link errors from C library routines that need malloc
Diffstat (limited to 'src/gos/gos_rules.h')
-rw-r--r-- | src/gos/gos_rules.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 */ /** @} */ |