diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-04-29 18:49:07 +0300 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-05-08 13:40:29 +0300 |
commit | e87693c54ca97ed3a6ed25f9eaae8ab223fc18b1 (patch) | |
tree | 54194ca979ac7e646ff3f10ed6d7f7753273f0be /include/singleton.hpp | |
parent | Expand pluginloader test coverage (diff) | |
download | smolbote-e87693c54ca97ed3a6ed25f9eaae8ab223fc18b1.tar.xz |
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
Diffstat (limited to 'include/singleton.hpp')
-rw-r--r-- | include/singleton.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
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 |