summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-25 12:01:09 +0200
committerLeo C2016-08-25 12:01:09 +0200
commit587f9485c13d44564c7f4d060f177be2adeffe14 (patch)
treeb42ffccf72f9f9a7754b16c6849fd6958a261955
parenta4f40a904ef9475b007e650c2ac501d16346feb1 (diff)
downloadz180-stamp-587f9485c13d44564c7f4d060f177be2adeffe14.zip
Set GCC_BUG_61443 macro automatically for the affected GCC versions.
-rw-r--r--include/common.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/common.h b/include/common.h
index dea638a..e22b7a1 100644
--- a/include/common.h
+++ b/include/common.h
@@ -10,6 +10,8 @@
#include <stdio.h>
#include <stdint.h>
+#define GCC_VERSION (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
+
#ifdef __AVR__
#include <avr/io.h>
#include <avr/pgmspace.h>
@@ -30,10 +32,13 @@ 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