summaryrefslogtreecommitdiff
path: root/external/libmwaw/0001-make-MWAW_FALLTHROUGH-decl.-more-verbose-again.patch.1
blob: dbbe6bfd204ca31a7dba6f1c10234ac4f7746c12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From a7648cda4017551c1c97c61362eb52d95fbe68e7 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Mon, 17 Jul 2017 10:43:01 +0200
Subject: [PATCH] make MWAW_FALLTHROUGH decl. more verbose again

... because older clang doesn't like the former one:
./libmwaw_internal.hxx:122:58: error: token is not a valid binary operator in a preprocessor subexpression
                                      ~~~~~~~~~~~~~~~~~~~^
---
 src/lib/libmwaw_internal.hxx | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lib/libmwaw_internal.hxx b/src/lib/libmwaw_internal.hxx
index 4c9580d..cbf0fc0 100644
--- a/src/lib/libmwaw_internal.hxx
+++ b/src/lib/libmwaw_internal.hxx
@@ -117,17 +117,20 @@ struct MWAW_shared_ptr_noop_deleter {
 #endif
 
 /** fall through attributes */
-#define MWAW_FALLTHROUGH
-#if defined(__clang__)
+#if defined(__clang__) && defined(__has_cpp_attribute)
-#  if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough)
-#    undef MWAW_FALLTHROUGH
+#  if __has_cpp_attribute(clang::fallthrough)
 #    define MWAW_FALLTHROUGH [[clang::fallthrough]]
+#  else
+#    define MWAW_FALLTHROUGH
 #  endif
 #elif defined(__GNUC__)
 #  if __GNUC__>=7
-#    undef MWAW_FALLTHROUGH
-#    define MWAW_FALLTHROUGH __attribute__ ((fallthrough))
+#    define MWAW_FALLTHROUGH [[fallthrough]]
+#  else
+#    define MWAW_FALLTHROUGH
 #  endif
+#else
+#  define MWAW_FALLTHROUGH
 #endif
 
 /* ---------- debug  --------------- */
-- 
2.13.0