aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2019-11-03 09:38:02 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2019-11-03 09:38:02 +0200
commit30b42a9617f5047cbaee13860b3f8b6ddf14a968 (patch)
tree89d40b7a00114c7ba6e64b9e019a74caebbd2a58
parentMake gtest optional dependency and remove -Dtesting (diff)
downloadsmolbote-30b42a9617f5047cbaee13860b3f8b6ddf14a968.tar.xz
Fix gcc compile errors and warnings
-rw-r--r--lib/configuration/configuration.h24
-rw-r--r--lib/pluginloader/meson.build2
-rw-r--r--src/main.cpp5
3 files changed, 22 insertions, 9 deletions
diff --git a/lib/configuration/configuration.h b/lib/configuration/configuration.h
index bc8f52e..b77685a 100644
--- a/lib/configuration/configuration.h
+++ b/lib/configuration/configuration.h
@@ -19,27 +19,39 @@
#include <QAction>
#include <QString>
+#if defined (__clang__)
+#define consumable(X) [[clang::consumable(X)]]
+#define return_typestate(X) [[clang::return_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 callable_when(X)
+#define param_typestate(X)
+#endif
+
typedef std::variant<std::string, int, bool> conf_value_t;
-class [[clang::consumable(unconsumed)]] Configuration : private std::unordered_map<std::string, conf_value_t>
+class consumable(unconsumed) Configuration : private std::unordered_map<std::string, conf_value_t>
{
public:
- [[clang::return_typestate(unconsumed)]]
+ return_typestate(unconsumed)
explicit Configuration();
- [[clang::return_typestate(unconsumed)]]
+ return_typestate(unconsumed)
explicit Configuration(std::initializer_list<std::pair<std::string, conf_value_t>> l) noexcept;
- explicit Configuration(Configuration &&other [[clang::param_typestate(unconsumed)]]) = default;
+ explicit Configuration(Configuration &&other param_typestate(unconsumed)) = default;
~Configuration() = default;
- [[clang::callable_when(unconsumed)]]
+ callable_when(unconsumed)
void read(std::basic_istream<char> &input);
template <typename T>
- [[clang::callable_when(unconsumed)]] std::optional<T> value(const char *path) const
+ callable_when(unconsumed) std::optional<T> value(const char *path) const
{
if(use_global)
return instance()->value<T>(path);
diff --git a/lib/pluginloader/meson.build b/lib/pluginloader/meson.build
index 1b68c8c..b93bf42 100644
--- a/lib/pluginloader/meson.build
+++ b/lib/pluginloader/meson.build
@@ -21,6 +21,6 @@ dep_pluginloader = declare_dependency(
link_with: static_library('plugin',
['pluginloader.cpp', pluginloader_moc, publicKey_h],
include_directories: include_directories('.'),
- dependencies: [dep_qt5])
+ dependencies: [dep_qt5, dependency('openssl', required: true)])
)
diff --git a/src/main.cpp b/src/main.cpp
index c6f4120..28887b9 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -83,12 +83,13 @@ int main(int argc, char **argv)
if(cmd_build)
return builtins::build();
- } catch(args::Help) {
+ } catch(args::Help &e) {
std::cout << parser;
+ Q_UNUSED(e);
//std::cout << "Available subcommands: " << command_keys << std::endl;
return 0;
- } catch(args::Error e) {
+ } catch(args::Error &e) {
std::cerr << e.what() << std::endl;
std::cerr << parser;
return -1;