From e87693c54ca97ed3a6ed25f9eaae8ab223fc18b1 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 29 Apr 2020 18:49:07 +0300 Subject: libwebengine Make src/webengine into a static library - Add some tests - Updated manpage - Remove WebProfileManager::id and WebProfileManager::instance - Add consumable semantics checks to WebProfileManager - Add WebProfileManager::walk Add ApplicationMenu class --- include/singleton.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/singleton.hpp (limited to 'include/singleton.hpp') diff --git a/include/singleton.hpp b/include/singleton.hpp new file mode 100644 index 0000000..d13e29e --- /dev/null +++ b/include/singleton.hpp @@ -0,0 +1,27 @@ +#ifndef SMOLBOTE_SINGLETON_HPP +#define SMOLBOTE_SINGLETON_HPP + +/* + * Clang consumed semantics + * States can be: unconsumed, consumed, unknown + * Mark classes with consumable(unconsumed) + * Mark constructors with return_typestate(unconsumed) + * Mark invalidating functions with set_typestate(consumed) + */ + +#if defined(__clang__) +#define consumable(X) [[clang::consumable(X)]] +#define return_typestate(X) [[clang::return_typestate(X)]] +#define set_typestate(X) [[clang::set_typestate(X)]] +#define callable_when(X) [[clang::callable_when(X)]] +#define param_typestate(X) [[clang::param_typestate(X)]] + +#else +#define consumable(X) +#define return_typestate(X) +#define set_typestate(X) +#define callable_when(X) +#define param_typestate(X) +#endif + +#endif // SMOLBOTE_SINGLETON_HPP -- cgit v1.2.1