diff --git a/include/adapters/net.hpp b/include/adapters/net.hpp index 445d57bf..daeefcad 100644 --- a/include/adapters/net.hpp +++ b/include/adapters/net.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include diff --git a/include/common.hpp b/include/common.hpp index dccf431e..1a4c0c6e 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #define POLYBAR_NS \ namespace polybar { \ @@ -19,22 +20,12 @@ #define PIPE_WRITE 1 #endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif - POLYBAR_NS -namespace placeholders = std::placeholders; - using std::string; using std::stringstream; using std::size_t; using std::move; -using std::bind; using std::forward; using std::pair; using std::function; diff --git a/include/components/logger.hpp b/include/components/logger.hpp index 6fdec973..03f90634 100644 --- a/include/components/logger.hpp +++ b/include/components/logger.hpp @@ -7,6 +7,13 @@ #include "common.hpp" +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + POLYBAR_NS enum class loglevel : uint8_t { diff --git a/include/utils/memory.hpp b/include/utils/memory.hpp index f95cea34..daec5a30 100644 --- a/include/utils/memory.hpp +++ b/include/utils/memory.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include #include "common.hpp" @@ -13,8 +13,8 @@ namespace memory_util { /** * Create a shared pointer using malloc/free */ - template - inline malloc_ptr_t make_malloc_ptr(Deleter deleter = free) { + template + inline malloc_ptr_t make_malloc_ptr(Deleter deleter = std::free) { return malloc_ptr_t(static_cast(calloc(1, Size)), deleter); } diff --git a/src/utils/command.cpp b/src/utils/command.cpp index c4c2e064..2eebf8ab 100644 --- a/src/utils/command.cpp +++ b/src/utils/command.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "errors.hpp" @@ -8,6 +9,13 @@ #include "utils/io.hpp" #include "utils/process.hpp" +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif + POLYBAR_NS command::command(const logger& logger, string cmd) : m_log(logger), m_cmd(move(cmd)) { diff --git a/tests/unit_tests/utils/math.cpp b/tests/unit_tests/utils/math.cpp index 4e9912ae..f7b48411 100644 --- a/tests/unit_tests/utils/math.cpp +++ b/tests/unit_tests/utils/math.cpp @@ -67,8 +67,8 @@ int main() { }; "round_to_nearest_5"_test = [] { - expect(math_util::nearest_5(52) == 55); - expect(math_util::nearest_5(9.1) == 5); + expect(math_util::nearest_5(52) == 50); + expect(math_util::nearest_5(9.1) == 10); expect(math_util::nearest_5(95.0) == 95); expect(math_util::nearest_5(94.9) == 95); expect(math_util::nearest_5(1) == 0);