µGFX  2.9
version 2.9
gos_rules.h
Go to the documentation of this file.
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.io/license.html
6  */
7 
8 /**
9  * @file src/gos/gos_rules.h
10  * @brief GOS safety rules header file.
11  *
12  * @addtogroup GOS
13  * @{
14  */
15 
16 #ifndef _GOS_RULES_H
17 #define _GOS_RULES_H
18 
19 #if !GFX_USE_OS_CHIBIOS && !GFX_USE_OS_WIN32 && !GFX_USE_OS_LINUX && !GFX_USE_OS_OSX && !GFX_USE_OS_RAW32 && !GFX_USE_OS_FREERTOS && !GFX_USE_OS_ECOS && !GFX_USE_OS_RAWRTOS && !GFX_USE_OS_ARDUINO && !GFX_USE_OS_CMSIS && !GFX_USE_OS_CMSIS2 && !GFX_USE_OS_KEIL && !GFX_USE_OS_RTX5 && !GFX_USE_OS_NIOS && !GFX_USE_OS_ZEPHYR && !GFX_USE_OS_QT
20  #error "GOS: No operating system has been defined."
21 #endif
22 
23 #if GFX_USE_OS_CHIBIOS + GFX_USE_OS_WIN32 + GFX_USE_OS_LINUX + GFX_USE_OS_OSX + GFX_USE_OS_RAW32 + GFX_USE_OS_FREERTOS + GFX_USE_OS_ECOS + GFX_USE_OS_RAWRTOS + GFX_USE_OS_ARDUINO + GFX_USE_OS_CMSIS + GFX_USE_OS_CMSIS2 + GFX_USE_OS_KEIL + GFX_USE_OS_RTX5 + GFX_USE_OS_NIOS + GFX_USE_OS_ZEPHYR + GFX_USE_OS_QT != 1 * GFXON
24  #error "GOS: More than one operation system has been defined as GFXON."
25 #endif
26 
27 #if GFX_FREERTOS_USE_TRACE && !GFX_USE_OS_FREERTOS
28  #error "GOS: GFX_FREERTOS_USE_TRACE is only available for the FreeRTOS port."
29 #endif
30 
31 #if GFX_USE_OS_ZEPHYR && !defined(CONFIG_HEAP_MEM_POOL_SIZE)
32  #error "GOS: CONFIG_HEAP_MEM_POOL_SIZE must be defined to use the Zephyr port."
33 #endif
34 
35 #if GFX_EMULATE_MALLOC
36  #if GFX_USE_OS_WIN32 || GFX_USE_OS_LINUX || GFX_USE_OS_OSX || GFX_USE_OS_ECOS || \
37  (GFX_OS_HEAP_SIZE == 0 && (GFX_USE_OS_RAW32 || GFX_USE_OS_ARDUINO || GFX_USE_OS_CMSIS || GFX_USE_OS_CMSIS2 || GFX_USE_OS_KEIL || GFX_USE_OS_RTX5))
38  #if GFX_DISPLAY_RULE_WARNINGS
39  #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
40  #warning "GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform"
41  #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
42  COMPILER_WARNING("GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform")
43  #endif
44  #endif
45  #undef GFX_EMULATE_MALLOC
46  #define GFX_EMULATE_MALLOC GFXOFF
47  #endif
48 #endif
49 
50 #endif /* _GOS_RULES_H */
51 /** @} */