From d1528ffc719de1bdd684da7d1a7e03e2d73f8ccb Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 12 Apr 2015 17:06:45 +0200 Subject: [PATCH] get rid of WIN32 ifdefs --- src/helpers.cpp | 4 ---- src/ncmpcpp.cpp | 4 ---- src/window.cpp | 8 ++------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index a70a9fcd..d5b74dc6 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -76,12 +76,8 @@ std::string timeFormat(const char *format, time_t t) std::string Timestamp(time_t t) { char result[32]; -# ifdef WIN32 - result[strftime(result, 31, "%x %X", localtime(&t))] = 0; -# else tm info; result[strftime(result, 31, "%x %X", localtime_r(&t, &info))] = 0; -# endif // WIN32 return result; } diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index fe1322c5..c8789259 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -55,7 +55,6 @@ namespace std::streambuf *cerr_buffer; bool run_resize_screen = false; -# if !defined(WIN32) void sighandler(int sig) { if (sig == SIGWINCH) @@ -67,7 +66,6 @@ namespace signal(sig, sighandler); # endif // __sun && __SVR4 } -# endif // !WIN32 void do_at_exit() { @@ -153,13 +151,11 @@ int main(int argc, char **argv) if (Config.mouse_support) mousemask(ALL_MOUSE_EVENTS, 0); -# ifndef WIN32 signal(SIGWINCH, sighandler); // we get it after connection with mpd is broken. // just ignore it and wait for the connection to // be reestablished. sigignore(SIGPIPE); -# endif // !WIN32 while (!Actions::ExitMainLoop) { diff --git a/src/window.cpp b/src/window.cpp index 1bdce3fc..73aa2c4c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -26,12 +26,8 @@ #include #include -#ifdef WIN32 -# include -#else -# include -# include -#endif +#include +#include #include "error.h" #include "utility/string.h"