aboutsummaryrefslogtreecommitdiffstats
path: root/libSYS
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-10-19 16:37:31 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-12-27 14:17:51 -0500
commit64134e60b348bb1686986e217f4020d6d108ed46 (patch)
treef067c7671c3cebdfe66c08394d9ed8c65f2b4c10 /libSYS
parentf828d3e16adfb4cb428b4f3a2c155f89853cebbe (diff)
downloadfdk-aac-64134e60b348bb1686986e217f4020d6d108ed46.tar.gz
fdk-aac-64134e60b348bb1686986e217f4020d6d108ed46.tar.bz2
fdk-aac-64134e60b348bb1686986e217f4020d6d108ed46.zip
Add FDK_FALLTHROUGH macro to prevent implicit-fallthrough compiler warnings
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I9f9064fb63ac40e18f245c00b7375b4874f2925b
Diffstat (limited to 'libSYS')
-rw-r--r--libSYS/include/machine_type.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libSYS/include/machine_type.h b/libSYS/include/machine_type.h
index be8de37..b66d5ad 100644
--- a/libSYS/include/machine_type.h
+++ b/libSYS/include/machine_type.h
@@ -379,6 +379,17 @@ it. Hence, a fully platform-independant way to use alignment is not supported.
#define LNK_SECTION_L1_DATA_A
#define LNK_SECTION_L1_DATA_B
+/**************************************************
+ * Macros regarding static code analysis
+ **************************************************/
+#if defined(__clang__)
+#define FDK_FALLTHROUGH [[clang::fallthrough]]
+#elif defined(__GNUC__) && (__GNUC__ >= 7)
+#define FDK_FALLTHROUGH __attribute__((fallthrough))
+#else
+#define FDK_FALLTHROUGH
+#endif
+
#ifdef _MSC_VER
/*
* Sometimes certain features are excluded from compilation and therefore the