summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-13 16:20:30 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-13 16:20:30 +0200
commit68f5f213bf0cbd0bd60a6849bf4379113ea06282 (patch)
tree7906520ed59fe4ef7c03de91d55f4f74b87e4072 /compat
parentdb47f9fc711f9b0abeb8461042c40c70d5a71021 (diff)
appease analyzer
Diffstat (limited to 'compat')
-rw-r--r--compat/meta.hpp13
-rw-r--r--compat/sleep.cpp2
2 files changed, 15 insertions, 0 deletions
diff --git a/compat/meta.hpp b/compat/meta.hpp
index 11c5ca0f..a116cebc 100644
--- a/compat/meta.hpp
+++ b/compat/meta.hpp
@@ -45,6 +45,15 @@ namespace meta::detail {
{
using type = to<xs...>;
};
+
+ template<typename...> struct cons_;
+
+ template<template<typename...> class t, typename x, typename... xs>
+ struct cons_<t<xs...>, x>
+ {
+ using type = t<x, xs...>;
+ };
+
} // ns meta::detail
namespace meta {
@@ -66,5 +75,9 @@ namespace meta {
template<typename... xs>
using last = lift<first, reverse<xs...>>;
+
+ template<typename... xs>
+ using cons = detail::cons_<xs...>;
+
} // ns meta
diff --git a/compat/sleep.cpp b/compat/sleep.cpp
index 6a22adeb..4ec61db5 100644
--- a/compat/sleep.cpp
+++ b/compat/sleep.cpp
@@ -11,11 +11,13 @@ namespace portable
OTR_COMPAT_EXPORT void sleep(int milliseconds)
{
if (milliseconds > 0)
+ {
#ifdef _WIN32
Sleep(milliseconds);
#else
usleep(unsigned(milliseconds) * 1000U); // takes microseconds
#endif
+ }
}
}