summaryrefslogtreecommitdiff
path: root/AK/Platform.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-07-24 08:16:59 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-07-24 08:16:59 +0200
commitecc35876af413174ed8b236494bce09e4a7a1a4b (patch)
tree72fa6afa1bc4cdbe1611d81d2c93707466d54f9a /AK/Platform.h
parentf88c5860df7ac20f8583c6b1be991842d850f808 (diff)
downloadserenity-ecc35876af413174ed8b236494bce09e4a7a1a4b.zip
AK: Move clang-specific consumable annotation helpers to Platform.h
Diffstat (limited to 'AK/Platform.h')
-rw-r--r--AK/Platform.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/AK/Platform.h b/AK/Platform.h
index 55eba697cd..7764b93923 100644
--- a/AK/Platform.h
+++ b/AK/Platform.h
@@ -10,3 +10,14 @@
#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch)
+#ifdef __clang__
+# define CONSUMABLE(initial_state) __attribute__((consumable(initial_state)))
+# define CALLABLE_WHEN(...) __attribute__((callable_when(__VA_ARGS__)))
+# define SET_TYPESTATE(state) __attribute__((set_typestate(state)))
+# define RETURN_TYPESTATE(state) __attribute__((return_typestate(state)))
+#else
+# define CONSUMABLE(initial_state)
+# define CALLABLE_WHEN(state)
+# define SET_TYPESTATE(state)
+# define RETURN_TYPESTATE(state)
+#endif