aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-04-29 18:49:07 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-05-08 13:40:29 +0300
commite87693c54ca97ed3a6ed25f9eaae8ab223fc18b1 (patch)
tree54194ca979ac7e646ff3f10ed6d7f7753273f0be /include
parentExpand pluginloader test coverage (diff)
downloadsmolbote-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')
-rw-r--r--include/meson.build1
-rw-r--r--include/singleton.hpp27
2 files changed, 28 insertions, 0 deletions
diff --git a/include/meson.build b/include/meson.build
index 7601966..1cd9957 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -1,4 +1,5 @@
plugininterfaces_include = include_directories('.')
+smolbote_include = include_directories('.')
install_headers('smolbote/filterinterface.hpp', 'smolbote/plugininterface.hpp',
subdir: 'smolbote')
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