Browse Source

Add compatibility with Visual Studio and make compile warning capabilities more cross platform

inmarket 2 years ago
parent
commit
9b73187100
52 changed files with 456 additions and 211 deletions
  1. 5 1
      boards/addons/gdisp/board_SSD1289_stm32f4discovery.h
  2. 5 1
      demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h
  3. 5 1
      demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h
  4. 9 3
      demos/modules/gos/threads/main.c
  5. 5 1
      demos/tools/uGFXnetDisplay/main.c
  6. 7 6
      drivers/gdisp/ILI9225/gdisp_lld_ili9225.c
  7. 7 6
      drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c
  8. 7 6
      drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c
  9. 7 6
      drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c
  10. 7 6
      drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c
  11. 7 6
      drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c
  12. 7 6
      drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c
  13. 7 6
      drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c
  14. 7 6
      drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c
  15. 7 6
      drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c
  16. 7 6
      drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c
  17. 7 6
      drivers/gdisp/R61505U/gdisp_lld_R61505U.c
  18. 14 8
      drivers/gdisp/RA6963/gdisp_lld_RA6963.c
  19. 7 6
      drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c
  20. 8 7
      drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c
  21. 7 6
      drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c
  22. 7 6
      drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c
  23. 7 6
      drivers/gdisp/ST7735/gdisp_lld_ST7735.c
  24. 7 6
      drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c
  25. 11 14
      drivers/gdisp/UC8173/gdisp_lld_UC8173.c
  26. 5 1
      drivers/multiple/Win32/gdisp_lld_Win32.c
  27. 5 1
      drivers/multiple/X/gdisp_lld_X.c
  28. 10 2
      drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c
  29. 6 0
      gfx.h
  30. 10 2
      src/gadc/gadc_rules.h
  31. 20 4
      src/gaudio/gaudio_rules.h
  32. 5 1
      src/gdisp/gdisp_image_png.c
  33. 37 8
      src/gdisp/gdisp_rules.h
  34. 37 21
      src/gfx_compilers.h
  35. 10 2
      src/ginput/ginput_rules.h
  36. 5 1
      src/gos/gos_arduino.c
  37. 5 1
      src/gos/gos_chibios.c
  38. 5 1
      src/gos/gos_cmsis.c
  39. 5 1
      src/gos/gos_ecos.c
  40. 5 1
      src/gos/gos_freertos.c
  41. 5 1
      src/gos/gos_raw32.c
  42. 5 1
      src/gos/gos_rawrtos.c
  43. 5 1
      src/gos/gos_rules.h
  44. 2 2
      src/gos/gos_win32.c
  45. 3 3
      src/gos/gos_win32.h
  46. 10 2
      src/gos/gos_x_threads_cortexm01.h
  47. 10 2
      src/gos/gos_x_threads_cortexm347.h
  48. 5 1
      src/gos/gos_x_threads_cortexm47fp.h
  49. 5 1
      src/gqueue/gqueue_rules.h
  50. 5 2
      src/gtimer/gtimer_rules.h
  51. 5 1
      src/gwin/gwin_list.c
  52. 45 9
      src/gwin/gwin_rules.h

+ 5 - 1
boards/addons/gdisp/board_SSD1289_stm32f4discovery.h

@@ -69,7 +69,11 @@ static GFXINLINE void init_board(GDisplay *g) {
69 69
 				dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM);
70 70
 				dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
71 71
 			#else
72
-				#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
72
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
73
+					#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
74
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
75
+					COMPILER_WARNING("GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance.")
76
+				#endif
73 77
 			#endif
74 78
 		#else
75 79
 			#error "GDISP: SSD1289 - FSMC not implemented for this device"

+ 5 - 1
demos/games/tetris/Example_Makefiles/stm32f4/board_SSD1289.h

@@ -69,7 +69,11 @@ static GFXINLINE void init_board(GDisplay *g) {
69 69
 				dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM);
70 70
 				dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
71 71
 			#else
72
-				#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
72
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
73
+					#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
74
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
75
+					COMPILER_WARNING("GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance.")
76
+				#endif
73 77
 			#endif
74 78
 		#else
75 79
 			#error "GDISP: SSD1289 - FSMC not implemented for this device"

+ 5 - 1
demos/games/tetris/Example_Makefiles/stm32f4_chibios_3.x/board_SSD1289.h

@@ -69,7 +69,11 @@ static GFXINLINE void init_board(GDisplay *g) {
69 69
 				dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM);
70 70
 				dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
71 71
 			#else
72
-				#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
72
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
73
+					#warning "GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance."
74
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
75
+					COMPILER_WARNING("GDISP: SSD1289 - DMA is supported for F2/F4 Devices. Define GDISP_USE_DMA in your gfxconf.h to turn this on for better performance.")
76
+				#endif
73 77
 			#endif
74 78
 		#else
75 79
 			#error "GDISP: SSD1289 - FSMC not implemented for this device"

+ 9 - 3
demos/modules/gos/threads/main.c

@@ -10,9 +10,15 @@
10 10
 	// Instead we use the Win32 API directly as that always works.
11 11
 	#define DEBUGWRITE(str)		WriteFile(GetStdHandle(STD_ERROR_HANDLE), str, strlen(str), &nres, 0)
12 12
 #else
13
-	#warning "You must alter this demo to define a DEBUGWRITE macro for your platform."
14
-	#warning "Be careful of using C library functions as they sometimes crash if they are not expecting stack changes (if possible use a multi-thread aware C library)"
15
-	#warning "You might flash LED's instead if that is better for your platform."
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "You must alter this demo to define a DEBUGWRITE macro for your platform."
15
+		#warning "Be careful of using C library functions as they sometimes crash if they are not expecting stack changes (if possible use a multi-thread aware C library)"
16
+		#warning "You might flash LED's instead if that is better for your platform."
17
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
18
+		COMPILER_WARNING("You must alter this demo to define a DEBUGWRITE macro for your platform.")
19
+		COMPILER_WARNING("Be careful of using C library functions as they sometimes crash if they are not expecting stack changes (if possible use a multi-thread aware C library)")
20
+		COMPILER_WARNING("You might flash LED's instead if that is better for your platform.")
21
+	#endif
16 22
 	#error "--"
17 23
 #endif
18 24
 

+ 5 - 1
demos/tools/uGFXnetDisplay/main.c

@@ -97,7 +97,11 @@
97 97
 
98 98
 	// Mutex protection is required for LWIP
99 99
 	#if !GDISP_GFXNET_UNSAFE_SOCKETS
100
-		#warning "GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you."
100
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
101
+			#warning "GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you."
102
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
103
+			COMPILER_WARNING("GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you.")
104
+		#endif
101 105
 		#undef GDISP_GFXNET_UNSAFE_SOCKETS
102 106
 		#define GDISP_GFXNET_UNSAFE_SOCKETS	TRUE
103 107
 	#endif

+ 7 - 6
drivers/gdisp/ILI9225/gdisp_lld_ili9225.c

@@ -7,13 +7,14 @@
7 7
 
8 8
 #if GFX_USE_GDISP
9 9
 
10
-#if defined(GDISP_SCREEN_HEIGHT)
11
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
-	#undef GISP_SCREEN_HEIGHT
13
-#endif
14
-#if defined(GDISP_SCREEN_WIDTH)
15
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
10
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
11
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
12
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
14
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
15
+	#endif
16 16
 	#undef GDISP_SCREEN_WIDTH
17
+	#undef GDISP_SCREEN_HEIGHT
17 18
 #endif
18 19
 
19 20
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9225

+ 7 - 6
drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c

@@ -10,13 +10,14 @@
10 10
 #if GFX_USE_GDISP
11 11
 
12 12
 /* This controller is only ever used with a 240 x 320 display */
13
-#if defined(GDISP_SCREEN_HEIGHT)
14
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
-	#undef GDISP_SCREEN_HEIGHT
16
-#endif
17
-#if defined(GDISP_SCREEN_WIDTH)
18
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
14
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
15
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
17
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
18
+	#endif
19 19
 	#undef GDISP_SCREEN_WIDTH
20
+	#undef GDISP_SCREEN_HEIGHT
20 21
 #endif
21 22
 
22 23
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9320

+ 7 - 6
drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c

@@ -10,13 +10,14 @@
10 10
 #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
11 11
 
12 12
 /* This controller is only ever used with a 240 x 320 display */
13
-#if defined(GDISP_SCREEN_HEIGHT)
14
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
-	#undef GDISP_SCREEN_HEIGHT
16
-#endif
17
-#if defined(GDISP_SCREEN_WIDTH)
18
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
14
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
15
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
17
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
18
+	#endif
19 19
 	#undef GDISP_SCREEN_WIDTH
20
+	#undef GDISP_SCREEN_HEIGHT
20 21
 #endif
21 22
 
22 23
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9325

+ 7 - 6
drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9341

+ 7 - 6
drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9342

+ 7 - 6
drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c

@@ -10,13 +10,14 @@
10 10
 #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/
11 11
 
12 12
 /* This controller is only ever used with a 240 x 320 display */
13
-#if defined(GDISP_SCREEN_HEIGHT)
14
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
-	#undef GDISP_SCREEN_HEIGHT
16
-#endif
17
-#if defined(GDISP_SCREEN_WIDTH)
18
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
14
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
15
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
17
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
18
+	#endif
19 19
 	#undef GDISP_SCREEN_WIDTH
20
+	#undef GDISP_SCREEN_HEIGHT
20 21
 #endif
21 22
 
22 23
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI93xx

+ 7 - 6
drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9481

+ 7 - 6
drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_ILI9488

+ 7 - 6
drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c

@@ -10,13 +10,14 @@
10 10
 #if GFX_USE_GDISP
11 11
 
12 12
 /* This controller is only ever used with a 240 x 320 display */
13
-#if defined(GDISP_SCREEN_HEIGHT)
14
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
-	#undef GDISP_SCREEN_HEIGHT
16
-#endif
17
-#if defined(GDISP_SCREEN_WIDTH)
18
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
14
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
15
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
17
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
18
+	#endif
19 19
 	#undef GDISP_SCREEN_WIDTH
20
+	#undef GDISP_SCREEN_HEIGHT
20 21
 #endif
21 22
 
22 23
 #define GDISP_DRIVER_VMT	GDISPVMT_LGDP4532

+ 7 - 6
drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GDISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_Nokia6610GE12

+ 7 - 6
drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c

@@ -41,13 +41,14 @@
41 41
  * orientation support and the streaming operations will be emulated (as described above).
42 42
  */
43 43
 
44
-#if defined(GDISP_SCREEN_HEIGHT)
45
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
46
-	#undef GDISP_SCREEN_HEIGHT
47
-#endif
48
-#if defined(GDISP_SCREEN_WIDTH)
49
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
44
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
45
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
46
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
47
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
48
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
49
+	#endif
50 50
 	#undef GDISP_SCREEN_WIDTH
51
+	#undef GDISP_SCREEN_HEIGHT
51 52
 #endif
52 53
 
53 54
 #define GDISP_DRIVER_VMT			GDISPVMT_Nokia6610GE8

+ 7 - 6
drivers/gdisp/R61505U/gdisp_lld_R61505U.c

@@ -10,13 +10,14 @@
10 10
 #if GFX_USE_GDISP
11 11
 
12 12
 /* This controller is only ever used with a 240 x 320 display */
13
-#if defined(GDISP_SCREEN_HEIGHT)
14
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
-	#undef GDISP_SCREEN_HEIGHT
16
-#endif
17
-#if defined(GDISP_SCREEN_WIDTH)
18
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
14
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
15
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
17
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
18
+	#endif
19 19
 	#undef GDISP_SCREEN_WIDTH
20
+	#undef GDISP_SCREEN_HEIGHT
20 21
 #endif
21 22
 
22 23
 #define GDISP_DRIVER_VMT			GDISPVMT_R61505U

+ 14 - 8
drivers/gdisp/RA6963/gdisp_lld_RA6963.c

@@ -31,14 +31,16 @@
31 31
 /*===========================================================================*/
32 32
 /* Driver local definitions.                                                 */
33 33
 /*===========================================================================*/
34
-#if defined(GDISP_SCREEN_HEIGHT)
35
-#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
36
-#undef GISP_SCREEN_HEIGHT
37
-#endif
38
-#if defined(GDISP_SCREEN_WIDTH)
39
-#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
40
-#undef GDISP_SCREEN_WIDTH
34
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
35
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
36
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
37
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
38
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
39
+	#endif
40
+	#undef GDISP_SCREEN_WIDTH
41
+	#undef GDISP_SCREEN_HEIGHT
41 42
 #endif
43
+
42 44
 #include "board_RA6963.h"
43 45
 
44 46
 // RA6963 Commands
@@ -213,7 +215,11 @@ static void set_viewport(GDisplay *g) {
213 215
     return;         //     0           + (  x      /         8        ) + (  y      *        16           )
214 216
   //uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA));
215 217
   uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x >> 3) + (g->p.y << 4)));
216
-#warning "check function set_viewport about the shift operations if you change the resolution!"
218
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
219
+		#warning "check function set_viewport about the shift operations if you change the resolution!"
220
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
221
+		COMPILER_WARNING("check function set_viewport about the shift operations if you change the resolution!")
222
+	#endif
217 223
   write_data(g, (uint8_t)addr);
218 224
   write_data(g, (uint8_t)(addr>>8));
219 225
   write_cmd(g, RA6963_SET_ADDRESS_POINTER);

+ 7 - 6
drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_S6D1121

+ 8 - 7
drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c

@@ -15,13 +15,14 @@
15 15
 
16 16
 #if GFX_USE_GDISP
17 17
 
18
-#if defined(GDISP_SCREEN_HEIGHT)
19
-#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
20
-#undef GDISP_SCREEN_HEIGHT
21
-#endif
22
-#if defined(GDISP_SCREEN_WIDTH)
23
-#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
24
-#undef GDISP_SCREEN_WIDTH
18
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
19
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
20
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
21
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
22
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
23
+	#endif
24
+	#undef GDISP_SCREEN_WIDTH
25
+	#undef GDISP_SCREEN_HEIGHT
25 26
 #endif
26 27
 
27 28
 #include "gdisp_lld_config.h"

+ 7 - 6
drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_SSD1331

+ 7 - 6
drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c

@@ -9,13 +9,14 @@
9 9
 
10 10
 #if GFX_USE_GDISP
11 11
 
12
-#if defined(GDISP_SCREEN_HEIGHT)
13
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
14
-	#undef GISP_SCREEN_HEIGHT
15
-#endif
16
-#if defined(GDISP_SCREEN_WIDTH)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
13
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
14
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
15
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
16
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
17
+	#endif
18 18
 	#undef GDISP_SCREEN_WIDTH
19
+	#undef GDISP_SCREEN_HEIGHT
19 20
 #endif
20 21
 
21 22
 #define GDISP_DRIVER_VMT			GDISPVMT_SSD1351

+ 7 - 6
drivers/gdisp/ST7735/gdisp_lld_ST7735.c

@@ -7,13 +7,14 @@
7 7
 
8 8
 #if GFX_USE_GDISP
9 9
 
10
-#if defined(GDISP_SCREEN_HEIGHT)
11
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
12
-	#undef GISP_SCREEN_HEIGHT
13
-#endif
14
-#if defined(GDISP_SCREEN_WIDTH)
15
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
10
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
11
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
12
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
13
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
14
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
15
+	#endif
16 16
 	#undef GDISP_SCREEN_WIDTH
17
+	#undef GDISP_SCREEN_HEIGHT
17 18
 #endif
18 19
 
19 20
 #define GDISP_DRIVER_VMT			GDISPVMT_ST7735

+ 7 - 6
drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c

@@ -13,13 +13,14 @@
13 13
 #include "gdisp_lld_config.h"
14 14
 #include "../../../src/gdisp/gdisp_driver.h"
15 15
 
16
-#if defined(GDISP_SCREEN_HEIGHT)
17
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
18
-	#undef GISP_SCREEN_HEIGHT
19
-#endif
20
-#if defined(GDISP_SCREEN_WIDTH)
21
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
16
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
17
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
18
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
19
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
20
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
21
+	#endif
22 22
 	#undef GDISP_SCREEN_WIDTH
23
+	#undef GDISP_SCREEN_HEIGHT
23 24
 #endif
24 25
 
25 26
 #ifndef LTDC_USE_DMA2D

+ 11 - 14
drivers/gdisp/UC8173/gdisp_lld_UC8173.c

@@ -15,21 +15,18 @@
15 15
 #include "UC8173.h"
16 16
 #include "board_UC8173.h"
17 17
 
18
-#if defined(GDISP_SCREEN_WIDTH)
19
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
20
-	#define GDISP_SCREEN_WIDTH		240
21
-#endif
22
-#if defined(GDISP_SCREEN_HEIGHT)
23
-	#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
24
-	#define GDISP_SCREEN_HEIGHT		240
18
+#if defined(GDISP_SCREEN_HEIGHT) || defined(GDISP_SCREEN_HEIGHT)
19
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
20
+		#warning "GDISP: This low level driver does not support setting a screen size. It is being ignored."
21
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
22
+		COMPILER_WARNING("GDISP: This low level driver does not support setting a screen size. It is being ignored.")
23
+	#endif
24
+	#undef GDISP_SCREEN_WIDTH
25
+	#undef GDISP_SCREEN_HEIGHT
25 26
 #endif
26 27
 
27
-#ifndef GDISP_SCREEN_HEIGHT
28
-	#define GDISP_SCREEN_HEIGHT		240
29
-#endif
30
-#ifndef GDISP_SCREEN_WIDTH
31
-	#define GDISP_SCREEN_WIDTH		240
32
-#endif
28
+#define GDISP_SCREEN_HEIGHT		240
29
+#define GDISP_SCREEN_WIDTH		240
33 30
 
34 31
 #define PRIV(g)						((UC8173_Private*)((g)->priv))
35 32
 #define FRAMEBUFFER(g)				((uint8_t *)(PRIV(g)+1))
@@ -354,7 +351,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g)
354 351
 		*p &=~ xybit(x, LLDCOLOR_MASK());
355 352
 		*p |= xybit(x, gdispColor2Native(g->p.color));
356 353
 
357
-//#warning ToDo
354
+// ToDo
358 355
 // There appears to be an issue in the silicone, still talking to the manufacturer about this one. Update will follow!
359 356
 #if 0
360 357
 		// Update the flush window region

+ 5 - 1
drivers/multiple/Win32/gdisp_lld_Win32.c

@@ -380,7 +380,11 @@
380 380
 			KMC_RECORDSTART, 0
381 381
 		};
382 382
 	#elif !GKEYBOARD_LAYOUT_OFF
383
-		#warning "The WIN32 keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size."
383
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
384
+			#warning "The WIN32 keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size."
385
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
386
+			COMPILER_WARNING("The WIN32 keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size.")
387
+		#endif
384 388
 	#endif
385 389
 
386 390
 	// Forward definitions

+ 5 - 1
drivers/multiple/X/gdisp_lld_X.c

@@ -132,7 +132,11 @@
132 132
 			KMC_RECORDSTART, 0
133 133
 		};
134 134
 	#elif !GKEYBOARD_LAYOUT_OFF
135
-		#warning "The X keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size."
135
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
136
+			#warning "The X keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size."
137
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
138
+			COMPILER_WARNING("The X keyboard driver is not using the layout engine. If no other keyboard is using it consider defining GKEYBOARD_LAYOUT_OFF=TRUE to save code size.")
139
+		#endif
136 140
 	#endif
137 141
 
138 142
 	// Forward definitions

+ 10 - 2
drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c

@@ -137,7 +137,11 @@
137 137
 
138 138
 	// Mutex protection is required for LWIP
139 139
 	#if !GDISP_GFXNET_UNSAFE_SOCKETS
140
-		#warning "GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you."
140
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
141
+			#warning "GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you."
142
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
143
+			COMPILER_WARNING("GDISP: uGFXnet - LWIP sockets are not thread-safe. GDISP_GFXNET_UNSAFE_SOCKETS has been turned on for you.")
144
+		#endif
141 145
 		#undef GDISP_GFXNET_UNSAFE_SOCKETS
142 146
 		#define GDISP_GFXNET_UNSAFE_SOCKETS	TRUE
143 147
 	#endif
@@ -352,7 +356,11 @@ static DECLARE_THREAD_FUNCTION(NetThread, param) {
352 356
     fdmax = listenfd; /* so far, it's this one*/
353 357
 
354 358
 	#if GDISP_GFXNET_BROKEN_LWIP_ACCEPT
355
-		#warning "Using GDISP_GFXNET_BROKEN_LWIP_ACCEPT limits the number of displays and the use of GFXNET. Avoid if possible!"
359
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
360
+			#warning "Using GDISP_GFXNET_BROKEN_LWIP_ACCEPT limits the number of displays and the use of GFXNET. Avoid if possible!"
361
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
362
+			COMPILER_WARNING("Using GDISP_GFXNET_BROKEN_LWIP_ACCEPT limits the number of displays and the use of GFXNET. Avoid if possible!")
363
+		#endif
356 364
 		len = sizeof(addr);
357 365
 		if((clientfd = accept(listenfd, (struct sockaddr *)&addr, &len)) == (SOCKET_TYPE)-1)
358 366
 			gfxHalt("GDISP: uGFXnet - Accept failed");

+ 6 - 0
gfx.h

@@ -38,6 +38,12 @@
38 38
 	#define TRUE        -1
39 39
 #endif
40 40
 
41
+// Macro concatination and strify - not API documented
42
+#define GFXCATX(a, b)	GFXCAT(a, b)
43
+#define GFXCAT(a, b)	a ## b
44
+#define GFXSTRX(a)		GFXSTR(a)
45
+#define GFXSTR(a)		#a
46
+
41 47
 /* gfxconf.h is the user's project configuration for the GFX system. */
42 48
 #include "gfxconf.h"
43 49
 

+ 10 - 2
src/gadc/gadc_rules.h

@@ -19,14 +19,22 @@
19 19
 #if GFX_USE_GADC
20 20
 	#if !GFX_USE_GTIMER
21 21
 		#if GFX_DISPLAY_RULE_WARNINGS
22
-			#warning "GADC: GFX_USE_GTIMER is required if GFX_USE_GADC is TRUE. It has been turned on for you."
22
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+				#warning "GADC: GFX_USE_GTIMER is required if GFX_USE_GADC is TRUE. It has been turned on for you."
24
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+				COMPILER_WARNING("GADC: GFX_USE_GTIMER is required if GFX_USE_GADC is TRUE. It has been turned on for you.")
26
+			#endif
23 27
 		#endif
24 28
 		#undef GFX_USE_GTIMER
25 29
 		#define	GFX_USE_GTIMER		TRUE
26 30
 	#endif
27 31
 	#if !GFX_USE_GQUEUE || !GQUEUE_NEED_GSYNC || !GQUEUE_NEED_BUFFERS
28 32
 		#if GFX_DISPLAY_RULE_WARNINGS
29
-			#warning "GADC: GFX_USE_GQUEUE, GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GADC is TRUE. They have been turned on for you."
33
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
34
+				#warning "GADC: GFX_USE_GQUEUE, GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GADC is TRUE. They have been turned on for you."
35
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
36
+				COMPILER_WARNING("GADC: GFX_USE_GQUEUE, GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GADC is TRUE. They have been turned on for you.")
37
+			#endif
30 38
 		#endif
31 39
 		#undef GFX_USE_GQUEUE
32 40
 		#define	GFX_USE_GQUEUE		TRUE

+ 20 - 4
src/gaudio/gaudio_rules.h

@@ -22,21 +22,33 @@
22 22
 	#endif
23 23
 	#if !GFX_USE_GQUEUE
24 24
 		#if GFX_DISPLAY_RULE_WARNINGS
25
-			#warning "GAUDIO: GFX_USE_GQUEUE is required if GFX_USE_GAUDIO is TRUE. It has been turned on for you."
25
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
26
+				#warning "GAUDIO: GFX_USE_GQUEUE is required if GFX_USE_GAUDIO is TRUE. It has been turned on for you."
27
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
28
+				COMPILER_WARNING("GAUDIO: GFX_USE_GQUEUE is required if GFX_USE_GAUDIO is TRUE. It has been turned on for you.")
29
+			#endif
26 30
 		#endif
27 31
 		#undef GFX_USE_GQUEUE
28 32
 		#define	GFX_USE_GQUEUE		TRUE
29 33
 	#endif
30 34
 	#if GAUDIO_NEED_PLAY && !GQUEUE_NEED_ASYNC
31 35
 		#if GFX_DISPLAY_RULE_WARNINGS
32
-			#warning "GAUDIO: GQUEUE_NEED_ASYNC is required if GAUDIO_NEED_PLAY is TRUE. It has been turned on for you."
36
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
37
+				#warning "GAUDIO: GQUEUE_NEED_ASYNC is required if GAUDIO_NEED_PLAY is TRUE. It has been turned on for you."
38
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
39
+				COMPILER_WARNING("GAUDIO: GQUEUE_NEED_ASYNC is required if GAUDIO_NEED_PLAY is TRUE. It has been turned on for you.")
40
+			#endif
33 41
 		#endif
34 42
 		#undef GQUEUE_NEED_ASYNC
35 43
 		#define	GQUEUE_NEED_ASYNC		TRUE
36 44
 	#endif
37 45
 	#if !GQUEUE_NEED_GSYNC || !GQUEUE_NEED_BUFFERS
38 46
 		#if GFX_DISPLAY_RULE_WARNINGS
39
-			#warning "GAUDIO: GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GAUDIO is TRUE. They have been turned on for you."
47
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
48
+				#warning "GAUDIO: GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GAUDIO is TRUE. They have been turned on for you."
49
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
50
+				COMPILER_WARNING("GAUDIO: GQUEUE_NEED_BUFFERS and GQUEUE_NEED_GSYNC are required if GFX_USE_GAUDIO is TRUE. They have been turned on for you.")
51
+			#endif
40 52
 		#endif
41 53
 		#undef GQUEUE_NEED_BUFFERS
42 54
 		#define	GQUEUE_NEED_BUFFERS		TRUE
@@ -45,7 +57,11 @@
45 57
 	#endif
46 58
 	#if GFX_USE_GEVENT && !GFX_USE_GTIMER
47 59
 		#if GFX_DISPLAY_RULE_WARNINGS
48
-			#warning "GAUDIO: GFX_USE_GTIMER is required if GFX_USE_GAUDIO and GFX_USE_GEVENT are TRUE. It has been turned on for you."
60
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
61
+				#warning "GAUDIO: GFX_USE_GTIMER is required if GFX_USE_GAUDIO and GFX_USE_GEVENT are TRUE. It has been turned on for you."
62
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
63
+				COMPILER_WARNING("GAUDIO: GFX_USE_GTIMER is required if GFX_USE_GAUDIO and GFX_USE_GEVENT are TRUE. It has been turned on for you.")
64
+			#endif
49 65
 		#endif
50 66
 		#undef GFX_USE_GTIMER
51 67
 		#define	GFX_USE_GTIMER		TRUE

+ 5 - 1
src/gdisp/gdisp_image_png.c

@@ -267,7 +267,11 @@ static void PNG_oColor(PNG_output *o, color_t c) {
267 267
 #if (GDISP_IMAGE_PNG_Z_BUFFER_SIZE & ~(GDISP_IMAGE_PNG_Z_BUFFER_SIZE-1)) == GDISP_IMAGE_PNG_Z_BUFFER_SIZE
268 268
 	#define WRAP_ZBUF(x)	{ x &= GDISP_IMAGE_PNG_Z_BUFFER_SIZE-1; }
269 269
 #else
270
-	#warning "PNG: GDISP_IMAGE_PNG_Z_BUFFER_SIZE is more efficient as a power of 2"
270
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
271
+		#warning "PNG: GDISP_IMAGE_PNG_Z_BUFFER_SIZE is more efficient as a power of 2"
272
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
273
+		COMPILER_WARNING("PNG: GDISP_IMAGE_PNG_Z_BUFFER_SIZE is more efficient as a power of 2")
274
+	#endif
271 275
 	#define WRAP_ZBUF(x)	{ if (x >= GDISP_IMAGE_PNG_Z_BUFFER_SIZE) x = 0; }
272 276
 #endif
273 277
 

+ 37 - 8
src/gdisp/gdisp_rules.h

@@ -19,7 +19,11 @@
19 19
 #if GFX_USE_GDISP
20 20
 	#if !GFX_USE_GDRIVER
21 21
 		#if GFX_DISPLAY_RULE_WARNINGS
22
-			#warning "GDISP: GFX_USE_GDRIVER is required. GFX_USE_GDRIVER has turned on for you."
22
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+				#warning "GDISP: GFX_USE_GDRIVER is required. GFX_USE_GDRIVER has turned on for you."
24
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+				COMPILER_WARNING("GDISP: GFX_USE_GDRIVER is required. GFX_USE_GDRIVER has turned on for you.")
26
+			#endif
23 27
 		#endif
24 28
 		#undef GFX_USE_GDRIVER
25 29
 		#define GFX_USE_GDRIVER				TRUE
@@ -34,7 +38,11 @@
34 38
 	#endif
35 39
 	#if GDISP_NEED_AUTOFLUSH && GDISP_NEED_TIMERFLUSH
36 40
 		#if GFX_DISPLAY_RULE_WARNINGS
37
-			#warning "GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has been disabled for you."
41
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
42
+				#warning "GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has been disabled for you."
43
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
44
+				COMPILER_WARNING("GDISP: Both GDISP_NEED_AUTOFLUSH and GDISP_NEED_TIMERFLUSH has been set. GDISP_NEED_TIMERFLUSH has been disabled for you.")
45
+			#endif
38 46
 		#endif
39 47
 		#undef GDISP_NEED_TIMERFLUSH
40 48
 		#define GDISP_NEED_TIMERFLUSH		FALSE
@@ -45,7 +53,11 @@
45 53
 		#endif
46 54
 		#if !GFX_USE_GTIMER
47 55
 			#if GFX_DISPLAY_RULE_WARNINGS
48
-				#warning "GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you."
56
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
57
+					#warning "GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you."
58
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
59
+					COMPILER_WARNING("GDISP: GDISP_NEED_TIMERFLUSH has been set but GFX_USE_GTIMER has not been set. It has been turned on for you.")
60
+				#endif
49 61
 			#endif
50 62
 			#undef GFX_USE_GTIMER
51 63
 			#define GFX_USE_GTIMER				TRUE
@@ -56,20 +68,33 @@
56 68
 	#if GDISP_NEED_ANTIALIAS && !GDISP_NEED_PIXELREAD
57 69
 		#if GDISP_HARDWARE_PIXELREAD
58 70
 			#if GFX_DISPLAY_RULE_WARNINGS
59
-				#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you."
71
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
72
+					#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you."
73
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
74
+					COMPILER_WARNING("GDISP: GDISP_NEED_ANTIALIAS has been set but GDISP_NEED_PIXELREAD has not. It has been turned on for you.")
75
+				#endif
60 76
 			#endif
61 77
 			#undef GDISP_NEED_PIXELREAD
62 78
 			#define GDISP_NEED_PIXELREAD	TRUE
63 79
 		#else
64 80
 			#if GFX_DISPLAY_RULE_WARNINGS
65
-				#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters."
81
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
82
+					#warning "GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters."
83
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
84
+					COMPILER_WARNING("GDISP: GDISP_NEED_ANTIALIAS has been set but your hardware does not support reading back pixels. Anti-aliasing will only occur for filled characters.")
85
+				#endif
66 86
 			#endif
67 87
 		#endif
68 88
 	#endif
69 89
 	#if (defined(GDISP_INCLUDE_FONT_SMALL) && GDISP_INCLUDE_FONT_SMALL) || (defined(GDISP_INCLUDE_FONT_LARGER) && GDISP_INCLUDE_FONT_LARGER)
70 90
 		#if GFX_DISPLAY_RULE_WARNINGS
71
-			#warning "GDISP: An old font (Small or Larger) has been defined. A single default font of UI2 has been added instead."
72
-			#warning "GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names."
91
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
92
+				#warning "GDISP: An old font (Small or Larger) has been defined. A single default font of UI2 has been added instead."
93
+				#warning "GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names."
94
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
95
+				COMPILER_WARNING("GDISP: An old font (Small or Larger) has been defined. A single default font of UI2 has been added instead.")
96
+				COMPILER_WARNING("GDISP: Please see <$(GFXLIB)/include/gdisp/fonts/fonts.h> for a list of available font names.")
97
+			#endif
73 98
 		#endif
74 99
 		#undef GDISP_INCLUDE_FONT_UI2
75 100
 		#define GDISP_INCLUDE_FONT_UI2		TRUE
@@ -77,7 +102,11 @@
77 102
 	#if GDISP_NEED_IMAGE
78 103
 		#if !GFX_USE_GFILE
79 104
 			#if GFX_DISPLAY_RULE_WARNINGS
80
-				#warning "GDISP: GFX_USE_GFILE is required when GDISP_NEED_IMAGE is TRUE. It has been turned on for you."
105
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
106
+					#warning "GDISP: GFX_USE_GFILE is required when GDISP_NEED_IMAGE is TRUE. It has been turned on for you."
107
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
108
+					COMPILER_WARNING("GDISP: GFX_USE_GFILE is required when GDISP_NEED_IMAGE is TRUE. It has been turned on for you.")
109
+				#endif
81 110
 			#endif
82 111
 			#undef GFX_USE_GFILE
83 112
 			#define GFX_USE_GFILE	TRUE

+ 37 - 21
src/gfx_compilers.h

@@ -285,12 +285,19 @@
285 285
 	 *
286 286
 	 *  Please keep this list in alphabetical order to keep it easier to maintain
287 287
 	 */
288
+	
288 289
 	#undef GFX_COMPILER_NAME
289 290
 	#undef GFX_COMPILER_TESTED
290 291
 	#undef GFX_COMPILER_VERSION_MAJOR
291 292
 	#undef GFX_COMPILER_VERSION_MINOR
292 293
 	#undef GFX_COMPILER_VERSION_PATCH
293 294
 	#undef GFX_COMPILER_VERSION_BUILD
295
+	#undef GFX_COMPILER_WARNING_TYPE
296
+		#define GFX_COMPILER_WARNING_NONE			0		/* Don't display warnings */
297
+		#define GFX_COMPILER_WARNING_DIRECT			1		/* Use #warning text, no macro expansion possible */
298
+		#define GFX_COMPILER_WARNING_MACRO			2		/* Use COMPILER_WARNING(text), macro expansion possible */
299
+		#define GFX_COMPILER_WARNING_GCC			3		/* Use GCC style warnings - converted to GFX_COMPILER_WARNING_MACRO */
300
+	
294 301
 	#if GFX_COMPILER ==  GFX_COMPILER_ACC
295 302
 		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
296 303
 			#warning "Compiler: ACC"
@@ -338,6 +345,7 @@
338 345
 		#define GFX_COMPILER_VERSION_MINOR			(((__ARMCC_VERSION)/10000)%10)
339 346
 		#define GFX_COMPILER_VERSION_PATCH			(((__ARMCC_VERSION)/1000)%10)
340 347
 		#define GFX_COMPILER_VERSION_BUILD			((__ARMCC_VERSION)%1000)
348
+		#pragma anon_unions							// Allow anonymous unions
341 349
 		#define __LITTLE_IF_NOT_BIG__				// Oops - Defines __BIG_ENDIAN but not __LITTLE_ENDIAN
342 350
 	#elif GFX_COMPILER == GFX_COMPILER_AZTEC
343 351
 		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
@@ -362,11 +370,9 @@
362 370
 		#define GFX_COMPILER_VERSION_MINOR			(((__CC65__)/0x10)%0x10)
363 371
 		#define GFX_COMPILER_VERSION_PATCH			((__CC65__)%0x10)
364 372
 	#elif GFX_COMPILER == GFX_COMPILER_CLANG
365
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
366
-			#warning "Compiler: CLANG"
367
-		#endif
368 373
 		#define GFX_COMPILER_NAME					"CLang (LLVM)"
369 374
 		#define GFX_COMPILER_TESTED					TRUE
375
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_GCC
370 376
 		#define GFX_COMPILER_VERSION_MAJOR			(__clang_major__)
371 377
 		#define GFX_COMPILER_VERSION_MINOR			(__clang_minor__)
372 378
 		#define GFX_COMPILER_VERSION_PATCH			(__clang_patchlevel__)
@@ -404,11 +410,9 @@
404 410
 		#define GFX_COMPILER_VERSION_MAJOR			(_RELEASE)
405 411
 		#define GFX_COMPILER_VERSION_MINOR			(_RELEASE_MINOR)
406 412
 	#elif GFX_COMPILER == GFX_COMPILER_CYGWIN
407
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
408
-			#warning "Compiler: CYGWIN"
409
-		#endif
410 413
 		#define GFX_COMPILER_NAME					"Cygwin"
411 414
 		#define GFX_COMPILER_TESTED					TRUE
415
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_GCC
412 416
 		#define GFX_COMPILER_VERSION_MAJOR			(__GNUC__)
413 417
 		#define GFX_COMPILER_VERSION_MINOR			(__GNUC_MINOR__)
414 418
 		#ifdef __GNUC_PATCHLEVEL__
@@ -489,11 +493,9 @@
489 493
 		#endif
490 494
 		#define GFX_COMPILER_NAME					"Fujitsu C++"
491 495
 	#elif GFX_COMPILER == GFX_COMPILER_GCC
492
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
493
-			#warning "Compiler: GCC"
494
-		#endif
495 496
 		#define GFX_COMPILER_NAME					"GCC"
496 497
 		#define GFX_COMPILER_TESTED					TRUE
498
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_GCC
497 499
 		#define GFX_COMPILER_VERSION_MAJOR			(__GNUC__)
498 500
 		#define GFX_COMPILER_VERSION_MINOR			(__GNUC_MINOR__)
499 501
 		#ifdef __GNUC_PATCHLEVEL__
@@ -654,11 +656,9 @@
654 656
 		#endif
655 657
 		#define GFX_COMPILER_NAME					"Microway NDP C"
656 658
 	#elif GFX_COMPILER == GFX_COMPILER_MINGW32
657
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
658
-			#warning "Compiler: MINGW32"
659
-		#endif
660 659
 		#define GFX_COMPILER_NAME					"MingW32"
661 660
 		#define GFX_COMPILER_TESTED					TRUE
661
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_GCC
662 662
 		#define GFX_COMPILER_VERSION_MAJOR			(__GNUC__)
663 663
 		#define GFX_COMPILER_VERSION_MINOR			(__GNUC_MINOR__)
664 664
 		#ifdef __GNUC_PATCHLEVEL__
@@ -666,10 +666,8 @@
666 666
 		#endif
667 667
 		#define DEPRECATED(msg)						__attribute__((deprecated(msg)))
668 668
 	#elif GFX_COMPILER == GFX_COMPILER_MINGW64
669
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
670
-			#warning "Compiler: MINGW64"
671
-		#endif
672 669
 		#define GFX_COMPILER_NAME					"MingW64"
670
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_GCC
673 671
 		#define GFX_COMPILER_VERSION_MAJOR			(__GNUC__)
674 672
 		#define GFX_COMPILER_VERSION_MINOR			(__GNUC_MINOR__)
675 673
 		#ifdef __GNUC_PATCHLEVEL__
@@ -890,9 +888,6 @@
890 888
 		#endif
891 889
 		#define GFX_COMPILER_NAME					"VBCC"
892 890
 	#elif GFX_COMPILER == GFX_COMPILER_VS
893
-		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
894
-			#warning "Compiler: VS"
895
-		#endif
896 891
 		#define GFX_COMPILER_NAME					"Microsoft Visual Studio"
897 892
 		#ifdef _MSC_FULL_VER
898 893
 			#if _MSC_FULL_VER < 100000000
@@ -912,6 +907,9 @@
912 907
 			#define GFX_COMPILER_VERSION_BUILD		(_MSC_BUILD)
913 908
 		#endif
914 909
 		#define DEPRECATED(msg)						__declspec(deprecated(msg))
910
+
911
+		#define GFX_COMPILER_WARNING_TYPE			GFX_COMPILER_WARNING_MACRO
912
+		#define COMPILER_WARNING(desc)				__pragma(message(__FILE__ "(" GFXSTRX(__LINE__) "): warning uGFX: " desc))
915 913
 	#elif GFX_COMPILER == GFX_COMPILER_WATCOM
916 914
 		#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
917 915
 			#warning "Compiler: WATCOM"
@@ -928,8 +926,17 @@
928 926
 		#define GFX_COMPILER_VERSION_MINOR			(((__ZTC__)/0x10)%0x10)
929 927
 		#define GFX_COMPILER_VERSION_PATCH			((__ZTC__)%0x10)
930 928
 	#endif
929
+
931 930
 	#ifndef GFX_COMPILER_TESTED
932
-		#define GFX_COMPILER_TESTED		FALSE
931
+		#define GFX_COMPILER_TESTED					FALSE
932
+	#endif
933
+	#ifndef GFX_COMPILER_WARNING_TYPE
934
+		#define GFX_COMPILER_WARNING_TYPE				GFX_COMPILER_WARNING_DIRECT
935
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_GCC
936
+		#undef GFX_COMPILER_WARNING_TYPE
937
+		#define GFX_COMPILER_WARNING_TYPE				GFX_COMPILER_WARNING_MACRO
938
+		#define COMPILER_PRAGMA(x)					_Pragma(#x)
939
+		#define COMPILER_WARNING(desc)				COMPILER_PRAGMA(GCC warning desc)
933 940
 	#endif
934 941
 	/************************************ End Compiler Settings *************************/
935 942
 
@@ -944,6 +951,11 @@
944 951
 		#define GFX_COMPILER_NAME		"Unknown"
945 952
 		#warning "You are using an unknown compiler. Please report this on the ugfx forum"
946 953
 	#endif
954
+	#if GFX_SHOW_COMPILER && GFX_DISPLAY_RULE_WARNINGS
955
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
956
+				COMPILER_WARNING(GFXSTRX(Compiler: GFX_COMPILER_NAME))
957
+		#endif
958
+	#endif
947 959
 
948 960
 	/**
949 961
 	 * @brief	This compiler is tested with ugfx
@@ -955,8 +967,12 @@
955 967
 	 * 			tested with a different compiler version. Please report any problems
956 968
 	 * 			on the ugfx forum.
957 969
 	 */
958
-	#if !GFX_COMPILER_TESTED
959
-		#warning "You are using an un-tested compiler. Please report any compile errors or warnings on the ugfx forum"
970
+	#if !GFX_COMPILER_TESTED && GFX_DISPLAY_RULE_WARNINGS
971
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
972
+			#warning "You are using an un-tested compiler. Please report any compile errors or warnings on the ugfx forum"
973
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
974
+			COMPILER_WARNING(GFXSTRX(You are using the un-tested GFX_COMPILER_NAME compiler. Please report any compile errors or warnings on the ugfx forum))
975
+		#endif
960 976
 	#endif
961 977
 
962 978
 	/**

+ 10 - 2
src/ginput/ginput_rules.h

@@ -19,14 +19,22 @@
19 19
 #if GFX_USE_GINPUT
20 20
 	#if !GFX_USE_GEVENT
21 21
 		#if GFX_DISPLAY_RULE_WARNINGS
22
-			#warning "GINPUT: GFX_USE_GEVENT is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
22
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+				#warning "GINPUT: GFX_USE_GEVENT is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
24
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+				COMPILER_WARNING("GINPUT: GFX_USE_GEVENT is required if GFX_USE_GINPUT is TRUE. It has been turned on for you.")
26
+			#endif
23 27
 		#endif
24 28
 		#undef GFX_USE_GEVENT
25 29
 		#define	GFX_USE_GEVENT		TRUE
26 30
 	#endif
27 31
 	#if !GFX_USE_GTIMER
28 32
 		#if GFX_DISPLAY_RULE_WARNINGS
29
-			#warning "GINPUT: GFX_USE_GTIMER is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
33
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
34
+				#warning "GINPUT: GFX_USE_GTIMER is required if GFX_USE_GINPUT is TRUE. It has been turned on for you."
35
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
36
+				COMPILER_WARNING("GINPUT: GFX_USE_GTIMER is required if GFX_USE_GINPUT is TRUE. It has been turned on for you.")
37
+			#endif
30 38
 		#endif
31 39
 		#undef GFX_USE_GTIMER
32 40
 		#define	GFX_USE_GTIMER		TRUE

+ 5 - 1
src/gos/gos_arduino.c

@@ -25,7 +25,11 @@ void _gosInit(void)
25 25
 	 * getting here!
26 26
 	 */
27 27
 	#if !GFX_OS_INIT_NO_WARNING
28
-		#warning "GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
28
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
29
+			#warning "GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
30
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
31
+			COMPILER_WARNING("GOS: Arduino - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!")
32
+		#endif
29 33
 	#endif
30 34
 
31 35
 	// Start the heap allocator

+ 5 - 1
src/gos/gos_chibios.c

@@ -49,7 +49,11 @@ void _gosInit(void)
49 49
 			}
50 50
 		#endif
51 51
 	#elif !GFX_OS_INIT_NO_WARNING
52
-		#warning "GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!"
52
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
53
+			#warning "GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!"
54
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
55
+			COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call halInit() and chSysInit() before gfxInit() in your application!")
56
+		#endif
53 57
 	#endif
54 58
 }
55 59
 

+ 5 - 1
src/gos/gos_cmsis.c

@@ -19,7 +19,11 @@ void _gosInit(void)
19 19
 		if (!osKernelRunning())
20 20
 			osKernelStart();
21 21
 	#elif !GFX_OS_INIT_NO_WARNING
22
-		#warning "GOS: Operating System initialization has been turned off. Make sure you call osKernelInitialize() and osKernelStart() before gfxInit() in your application!"
22
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+			#warning "GOS: Operating System initialization has been turned off. Make sure you call osKernelInitialize() and osKernelStart() before gfxInit() in your application!"
24
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+			COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call osKernelInitialize() and osKernelStart() before gfxInit() in your application!")
26
+		#endif
23 27
 	#endif
24 28
 
25 29
 	// Set up the heap allocator

+ 5 - 1
src/gos/gos_ecos.c

@@ -15,7 +15,11 @@ void _gosInit(void)
15 15
 		#error "GOS: Operating System initialization for eCos is not yet implemented in uGFX. Please set GFX_OS_NO_INIT to TRUE in your gfxconf.h"
16 16
 	#endif
17 17
 	#if !GFX_OS_INIT_NO_WARNING
18
-		#warning "GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!"
18
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
19
+			#warning "GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!"
20
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
21
+			COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call cyg_scheduler_start() before gfxInit() in your application!")
22
+		#endif
19 23
 	#endif
20 24
 }
21 25
 

+ 5 - 1
src/gos/gos_freertos.c

@@ -33,7 +33,11 @@
33 33
 void _gosInit(void)
34 34
 {
35 35
 	#if GFX_OS_NO_INIT && !GFX_OS_INIT_NO_WARNING
36
-		#warning "GOS: Operating System initialization has been turned off. Make sure you call vTaskStartScheduler()."
36
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
37
+			#warning "GOS: Operating System initialization has been turned off. Make sure you call vTaskStartScheduler()."
38
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
39
+			COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call vTaskStartScheduler().")
40
+		#endif
37 41
 	#endif
38 42
 }
39 43
 

+ 5 - 1
src/gos/gos_raw32.c

@@ -26,7 +26,11 @@ void _gosInit(void)
26 26
 	 * getting here!
27 27
 	 */
28 28
 	#if !GFX_OS_INIT_NO_WARNING
29
-		#warning "GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
29
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
30
+			#warning "GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!"
31
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
32
+			COMPILER_WARNING("GOS: Raw32 - Make sure you initialize your hardware and the C runtime before calling gfxInit() in your application!")
33
+		#endif
30 34
 	#endif
31 35
 
32 36
 	// Set up the heap allocator

+ 5 - 1
src/gos/gos_rawrtos.c

@@ -28,7 +28,11 @@ void _gosInit(void)
28 28
 		#error "GOS: Operating System initialization for RawRTOS is not yet implemented in uGFX. Please set GFX_OS_NO_INIT to TRUE in your gfxconf.h"
29 29
 	#endif
30 30
 	#if !GFX_OS_INIT_NO_WARNING
31
-		#warning "GOS: Operating System initialization has been turned off. Make sure you call raw_os_start() before gfxInit() in your application!"
31
+		#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
32
+			#warning "GOS: Operating System initialization has been turned off. Make sure you call raw_os_start() before gfxInit() in your application!"
33
+		#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
34
+			COMPILER_WARNING("GOS: Operating System initialization has been turned off. Make sure you call raw_os_start() before gfxInit() in your application!")
35
+		#endif
32 36
 	#endif
33 37
 }
34 38
 

+ 5 - 1
src/gos/gos_rules.h

@@ -32,7 +32,11 @@
32 32
 	#if GFX_USE_OS_WIN32 || GFX_USE_OS_LINUX || GFX_USE_OS_OSX || GFX_USE_OS_ECOS || \
33 33
 			(GFX_OS_HEAP_SIZE == 0 && (GFX_USE_OS_RAW32 || GFX_USE_OS_ARDUINO || GFX_USE_OS_CMSIS || GFX_USE_OS_KEIL))
34 34
 		#if GFX_DISPLAY_RULE_WARNINGS
35
-			#warning "GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform"
35
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
36
+				#warning "GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform"
37
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
38
+				COMPILER_WARNING("GOS: Cannot emulate malloc as gfxAlloc() internally uses malloc on this platform")
39
+			#endif
36 40
 		#endif
37 41
 		#undef GFX_EMULATE_MALLOC
38 42
 		#define GFX_EMULATE_MALLOC	FALSE

+ 2 - 2
src/gos/gos_win32.c

@@ -78,7 +78,7 @@ bool_t gfxSemWait(gfxSem *psem, delaytime_t ms) {
78 78
 	return WaitForSingleObject(*psem, ms) == WAIT_OBJECT_0;
79 79
 }
80 80
 
81
-typedef LONG __stdcall (*_NtQuerySemaphore)(
81
+typedef LONG (__stdcall *_NtQuerySemaphore)(
82 82
     HANDLE SemaphoreHandle,
83 83
     DWORD SemaphoreInformationClass, /* Would be SEMAPHORE_INFORMATION_CLASS */
84 84
     PVOID SemaphoreInformation,      /* but this is to much to dump here     */
@@ -101,7 +101,7 @@ semcount_t gfxSemCounter(gfxSem *pSem) {
101 101
     return BasicInfo.CurrentCount;
102 102
 }
103 103
 
104
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
104
+gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param) {
105 105
 	(void)	stackarea;
106 106
 	HANDLE	thd;
107 107
 

+ 3 - 3
src/gos/gos_win32.h

@@ -46,8 +46,8 @@ typedef LONG				semcount_t;
46 46
 typedef DWORD				threadreturn_t;
47 47
 typedef int					threadpriority_t;
48 48
 
49
-#define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t WINAPI fnName(void *param)
50
-#define DECLARE_THREAD_STACK(name, sz)			uint8_t name[0];
49
+#define DECLARE_THREAD_FUNCTION(fnName, param)	threadreturn_t (WINAPI fnName)(void *param)
50
+#define DECLARE_THREAD_STACK(name, sz)			uint8_t name[1];
51 51
 #define THREAD_RETURN(retval)					return retval
52 52
 
53 53
 #define TIME_IMMEDIATE				0
@@ -96,7 +96,7 @@ bool_t gfxSemWait(gfxSem *psem, delaytime_t ms);
96 96
 semcount_t gfxSemCounter(gfxSem *pSem);
97 97
 void gfxSystemLock(void);
98 98
 void gfxSystemUnlock(void);
99
-gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param);
99
+gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION(*fn,p), void *param);
100 100
 threadreturn_t gfxThreadWait(gfxThreadHandle thread);
101 101
 
102 102
 #ifdef __cplusplus

+ 10 - 2
src/gos/gos_x_threads_cortexm01.h

@@ -13,7 +13,11 @@
13 13
  */
14 14
 
15 15
 #if CORTEX_USE_FPU
16
-	#warning "GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead"
16
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
17
+		#warning "GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead"
18
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
19
+		COMPILER_WARNING("GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead")
20
+	#endif
17 21
 #endif
18 22
 
19 23
 #if GFX_COMPILER == GFX_COMPILER_GCC || GFX_COMPILER == GFX_COMPILER_CYGWIN || GFX_COMPILER == GFX_COMPILER_MINGW32 || GFX_COMPILER == GFX_COMPILER_MINGW64
@@ -128,5 +132,9 @@
128 132
 	}
129 133
 
130 134
 #else
131
-	#warning "GOS: Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
135
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
136
+		#warning "GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
137
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
138
+		COMPILER_WARNING("GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching")
139
+	#endif
132 140
 #endif

+ 10 - 2
src/gos/gos_x_threads_cortexm347.h

@@ -14,7 +14,11 @@
14 14
 
15 15
 
16 16
 #if CORTEX_USE_FPU
17
-	#warning "GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead"
17
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
18
+		#warning "GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead"
19
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
20
+		COMPILER_WARNING("GOS Threads: You have specified GFX_CPU=GFX_CPU_CORTX_M? with no hardware floating point support but CORTEX_USE_FPU is TRUE. Try using GFX_CPU_GFX_CPU_CORTEX_M?_FP instead")
21
+	#endif
18 22
 #endif
19 23
 
20 24
 #if GFX_COMPILER == GFX_COMPILER_GCC || GFX_COMPILER == GFX_COMPILER_CYGWIN || GFX_COMPILER == GFX_COMPILER_MINGW32 || GFX_COMPILER == GFX_COMPILER_MINGW64
@@ -91,5 +95,9 @@
91 95
 	}
92 96
 
93 97
 #else
94
-	#warning "GOS: Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
98
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
99
+		#warning "GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
100
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
101
+		COMPILER_WARNING("GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching")
102
+	#endif
95 103
 #endif

+ 5 - 1
src/gos/gos_x_threads_cortexm47fp.h

@@ -92,5 +92,9 @@
92 92
 	}
93 93
 
94 94
 #else
95
-	#warning "GOS: Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
95
+	#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
96
+		#warning "GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching"
97
+	#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
98
+		COMPILER_WARNING("GOS Threads: You have specified a specific CPU but your compiler is not supported. Defaulting to CLIB switching")
99
+	#endif
96 100
 #endif

+ 5 - 1
src/gqueue/gqueue_rules.h

@@ -19,7 +19,11 @@
19 19
 #if GFX_USE_GQUEUE
20 20
 	#if GQUEUE_NEED_BUFFERS && !GQUEUE_NEED_GSYNC
21 21
 		#if GFX_DISPLAY_RULE_WARNINGS
22
-			#warning "GQUEUE: GQUEUE_NEED_GSYNC is required if GQUEUE_NEED_BUFFERS is TRUE. It has been turned on for you."
22
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+				#warning "GQUEUE: GQUEUE_NEED_GSYNC is required if GQUEUE_NEED_BUFFERS is TRUE. It has been turned on for you."
24
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+				COMPILER_WARNING("GQUEUE: GQUEUE_NEED_GSYNC is required if GQUEUE_NEED_BUFFERS is TRUE. It has been turned on for you.")
26
+			#endif
23 27
 		#endif
24 28
 		#undef GQUEUE_NEED_GSYNC
25 29
 		#define	GQUEUE_NEED_GSYNC		TRUE

+ 5 - 2
src/gtimer/gtimer_rules.h

@@ -19,8 +19,11 @@
19 19
 #if GFX_USE_GTIMER
20 20
 	#if GFX_USE_GDISP && !GDISP_NEED_MULTITHREAD
21 21
 		#if GFX_DISPLAY_RULE_WARNINGS
22
-			#warning "GTIMER: GDISP_NEED_MULTITHREAD has not been specified."
23
-			#warning "GTIMER: Make sure you are not performing any GDISP/GWIN drawing operations in the timer callback!"
22
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
23
+				#warning "GTIMER: GDISP_NEED_MULTITHREAD has not been specified. Make sure you are not performing any GDISP/GWIN drawing operations in the timer callback!"
24
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
25
+				COMPILER_WARNING("GTIMER: GDISP_NEED_MULTITHREAD has not been specified. Make sure you are not performing any GDISP/GWIN drawing operations in the timer callback!")
26
+			#endif
24 27
 		#endif
25 28
 	#endif
26 29
 #endif

+ 5 - 1
src/gwin/gwin_list.c

@@ -747,7 +747,11 @@ void gwinListDefaultDraw(GWidgetObject* gw, void* param) {
747 747
 			gdispGFillConvexPoly(gw->g.display, gw->g.x+iwidth+((LST_SCROLLWIDTH-LST_ARROW_SZ)/2+2), gw->g.y+(LST_ARROW_SZ/2+1), upArrow, 3, ps->fill);
748 748
 			gdispGFillConvexPoly(gw->g.display, gw->g.x+iwidth+((LST_SCROLLWIDTH-LST_ARROW_SZ)/2+2), gw->g.y+gw->g.height-(LST_ARROW_SZ+LST_ARROW_SZ/2+1), downArrow, 3, ps->fill);
749 749
 		#else
750
-			#warning "GWIN: Lists display better when GDISP_NEED_CONVEX_POLYGON is turned on"
750
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
751
+				#warning "GWIN: Lists display better when GDISP_NEED_CONVEX_POLYGON is turned on"
752
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
753
+				COMPILER_WARNING("GWIN: Lists display better when GDISP_NEED_CONVEX_POLYGON is turned on")
754
+			#endif
751 755
 			gdispGFillArea(gw->g.display, gw->g.x+iwidth+((LST_SCROLLWIDTH-LST_ARROW_SZ)/2+2), gw->g.y+(LST_ARROW_SZ/2+1), LST_ARROW_SZ, LST_ARROW_SZ, ps->fill);
752 756
 			gdispGFillArea(gw->g.display, gw->g.x+iwidth+((LST_SCROLLWIDTH-LST_ARROW_SZ)/2+2), gw->g.y+gw->g.height-(LST_ARROW_SZ+LST_ARROW_SZ/2+1), LST_ARROW_SZ, LST_ARROW_SZ, ps->fill);
753 757
 		#endif

+ 45 - 9
src/gwin/gwin_rules.h

@@ -23,7 +23,11 @@
23 23
 	#endif
24 24
 	#if !GDISP_NEED_CLIP
25 25
 		#if GFX_DISPLAY_RULE_WARNINGS
26
-			#warning "GWIN: Drawing can occur outside the defined windows as GDISP_NEED_CLIP is FALSE"
26
+			#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
27
+				#warning "GWIN: Drawing can occur outside the defined windows as GDISP_NEED_CLIP is FALSE"
28
+			#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
29
+				COMPILER_WARNING("GWIN: Drawing can occur outside the defined windows as GDISP_NEED_CLIP is FALSE")
30
+			#endif
27 31
 		#endif
28 32
 	#endif
29 33
 
@@ -31,7 +35,11 @@
31 35
 	#if GWIN_NEED_TABSET || GWIN_NEED_FRAME || GWIN_NEED_CONTAINER
32 36
 		#if !GWIN_NEED_CONTAINERS
33 37
 			#if GFX_DISPLAY_RULE_WARNINGS
34
-				#warning "GWIN: GWIN_NEED_CONTAINERS is required when a container is enabled. It has been turned on for you."
38
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
39
+					#warning "GWIN: GWIN_NEED_CONTAINERS is required when a container is enabled. It has been turned on for you."
40
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
41
+					COMPILER_WARNING("GWIN: GWIN_NEED_CONTAINERS is required when a container is enabled. It has been turned on for you.")
42
+				#endif
35 43
 			#endif
36 44
 			#undef GWIN_NEED_CONTAINERS
37 45
 			#define GWIN_NEED_CONTAINERS	TRUE
@@ -41,7 +49,11 @@
41 49
 		GWIN_NEED_IMAGE || GWIN_NEED_CHECKBOX || GWIN_NEED_PROGRESSBAR || GWIN_NEED_KEYBOARD || GWIN_NEED_TEXTEDIT
42 50
 		#if !GWIN_NEED_WIDGET
43 51
 			#if GFX_DISPLAY_RULE_WARNINGS
44
-				#warning "GWIN: GWIN_NEED_WIDGET is required when a widget is used. It has been turned on for you."
52
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
53
+					#warning "GWIN: GWIN_NEED_WIDGET is required when a widget is used. It has been turned on for you."
54
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
55
+					COMPILER_WARNING("GWIN: GWIN_NEED_WIDGET is required when a widget is used. It has been turned on for you.")
56
+				#endif
45 57
 			#endif
46 58
 			#undef GWIN_NEED_WIDGET
47 59
 			#define GWIN_NEED_WIDGET	TRUE
@@ -52,7 +64,11 @@
52 64
 	#if GWIN_NEED_CONTAINERS
53 65
 		#if !GWIN_NEED_WIDGET
54 66
 			#if GFX_DISPLAY_RULE_WARNINGS
55
-				#warning "GWIN: GWIN_NEED_WIDGET is required when GWIN_NEED_CONTAINERS is enabled. It has been turned on for you."
67
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
68
+					#warning "GWIN: GWIN_NEED_WIDGET is required when GWIN_NEED_CONTAINERS is enabled. It has been turned on for you."
69
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
70
+					COMPILER_WARNING("GWIN: GWIN_NEED_WIDGET is required when GWIN_NEED_CONTAINERS is enabled. It has been turned on for you.")
71
+				#endif
56 72
 			#endif
57 73
 			#undef GWIN_NEED_WIDGET
58 74
 			#define GWIN_NEED_WIDGET	TRUE
@@ -68,14 +84,22 @@
68 84
 		#endif
69 85
 		#if !GWIN_NEED_WINDOWMANAGER
70 86
 			#if GFX_DISPLAY_RULE_WARNINGS
71
-				#warning "GWIN: GWIN_NEED_WINDOWMANAGER is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you."
87
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
88
+					#warning "GWIN: GWIN_NEED_WINDOWMANAGER is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you."
89
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
90
+					COMPILER_WARNING("GWIN: GWIN_NEED_WINDOWMANAGER is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you.")
91
+				#endif
72 92
 			#endif
73 93
 			#undef GWIN_NEED_WINDOWMANAGER
74 94
 			#define GWIN_NEED_WINDOWMANAGER	TRUE
75 95
 		#endif
76 96
 		#if !GDISP_NEED_MULTITHREAD
77 97
 			#if GFX_DISPLAY_RULE_WARNINGS
78
-				#warning "GWIN: GDISP_NEED_MULTITHREAD is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you"
98
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
99
+					#warning "GWIN: GDISP_NEED_MULTITHREAD is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you"
100
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
101
+					COMPILER_WARNING("GWIN: GDISP_NEED_MULTITHREAD is required if GWIN_NEED_WIDGET is TRUE. It has been turned on for you")
102
+				#endif
79 103
 			#endif
80 104
 			#undef GDISP_NEED_MULTITHREAD
81 105
 			#define GDISP_NEED_MULTITHREAD	TRUE
@@ -84,7 +108,11 @@
84 108
 	#if GWIN_NEED_WINDOWMANAGER
85 109
 		#if !GFX_USE_GQUEUE || !GQUEUE_NEED_ASYNC
86 110
 			#if GFX_DISPLAY_RULE_WARNINGS
87
-				#warning "GWIN: GFX_USE_GQUEUE and GQUEUE_NEED_ASYNC is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you."
111
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
112
+					#warning "GWIN: GFX_USE_GQUEUE and GQUEUE_NEED_ASYNC is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you."
113
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
114
+					COMPILER_WARNING("GWIN: GFX_USE_GQUEUE and GQUEUE_NEED_ASYNC is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you.")
115
+				#endif
88 116
 			#endif
89 117
 			#undef GFX_USE_GQUEUE
90 118
 			#undef GQUEUE_NEED_ASYNC
@@ -93,7 +121,11 @@
93 121
 		#endif
94 122
 		#if !GFX_USE_GTIMER
95 123
 			#if GFX_DISPLAY_RULE_WARNINGS
96
-				#warning "GWIN: GFX_USE_GTIMER is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you."
124
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
125
+					#warning "GWIN: GFX_USE_GTIMER is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you."
126
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
127
+					COMPILER_WARNING("GWIN: GFX_USE_GTIMER is required if GWIN_NEED_WINDOWMANAGER is TRUE. It has been turned on for you.")
128
+				#endif
97 129
 			#endif
98 130
 			#undef GFX_USE_GTIMER
99 131
 			#define GFX_USE_GTIMER		TRUE
@@ -109,7 +141,11 @@
109 141
 	#if GWIN_NEED_RADIO
110 142
 		#if !GDISP_NEED_CIRCLE
111 143
 			#if GFX_DISPLAY_RULE_WARNINGS
112
-				#warning "GWIN: GDISP_NEED_CIRCLE should be set to TRUE for much nicer radio button widgets."
144
+				#if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT
145
+					#warning "GWIN: GDISP_NEED_CIRCLE should be set to TRUE for much nicer radio button widgets."
146
+				#elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO
147
+					COMPILER_WARNING("GWIN: GDISP_NEED_CIRCLE should be set to TRUE for much nicer radio button widgets.")
148
+				#endif
113 149
 			#endif
114 150
 		#endif
115 151
 	#endif