summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-02-28 07:36:58 +0100
committerAndreas Schneider <asn@samba.org>2018-03-22 14:01:49 +0100
commit33da03f478955daa04adca67fc012379bf0d2a39 (patch)
treed0c91241174eedaf853cd105ca8208073b7cd87b /ConfigureChecks.cmake
parentf7fc3f5294fc4bfc917fe5827594b774be730f4b (diff)
downloadsocket_wrapper-33da03f478955daa04adca67fc012379bf0d2a39.tar.gz
socket_wrapper-33da03f478955daa04adca67fc012379bf0d2a39.tar.xz
socket_wrapper-33da03f478955daa04adca67fc012379bf0d2a39.zip
cmake: Fix configure check for fall-through attribute
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake17
1 files changed, 4 insertions, 13 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index f06e780..93010f4 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -205,22 +205,13 @@ int main(void) {
check_c_source_compiles("
#define FALL_THROUGH __attribute__((fallthrough))
-enum direction_e {
- UP = 0,
- DOWN,
-};
-
int main(void) {
- enum direction_e key = UP;
- int i = 10;
- int j = 0;
+ int i = 2;
- switch (key) {
- case UP:
- i = 5;
+ switch (i) {
+ case 0:
FALL_THROUGH;
- case DOWN:
- j = i * 2;
+ case 1:
break;
default:
break;