]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - include/common.h
commandtable, flags: int --> uint8_t/uint_fast8_t. Macro UNUSED for Parameters/Variables
[z180-stamp.git] / include / common.h
index 10c4417d8b0c147de15a20e142a81fb93265a9d6..1064bf3d050272d8711a535e125b311e62ca2000 100644 (file)
@@ -1,12 +1,20 @@
 /*
  * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
  *
- * SPDX-License-Identifier:    GPL-2.0+
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #ifndef COMMON_H
 #define COMMON_H
 
+#include <stdio.h>
+#include <stdint.h>
+
+#define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
+
+#define USED __attribute__((used))
+#define UNUSED __attribute__((unused))
+
 #ifdef __AVR__
 #include <avr/io.h>
 #include <avr/pgmspace.h>
@@ -27,17 +35,18 @@ struct bits {
 
 #define SBIT(port,pin) ((*(volatile struct bits*)&port).b##pin)
 
-//TODO:
+//GCC bug PR61443
 //  Known to work: 4.8.4, 4.9.1
 //  Known to fail: 4.8.3, 4.9.0
+
+#if (GCC_VERSION < 40804) || (GCC_VERSION == 40900)
 #define GCC_BUG_61443 1
+#endif /* PR61443 */
 
 #else
 // TODO: stm32
 #endif /* __AVR__ */
 
-#include <stdio.h>
-
 #ifdef __FLASH
 #define FLASH __flash
 #define MEMX __memx