get rid of WIN32 ifdefs
This commit is contained in:
@@ -76,12 +76,8 @@ std::string timeFormat(const char *format, time_t t)
|
|||||||
std::string Timestamp(time_t t)
|
std::string Timestamp(time_t t)
|
||||||
{
|
{
|
||||||
char result[32];
|
char result[32];
|
||||||
# ifdef WIN32
|
|
||||||
result[strftime(result, 31, "%x %X", localtime(&t))] = 0;
|
|
||||||
# else
|
|
||||||
tm info;
|
tm info;
|
||||||
result[strftime(result, 31, "%x %X", localtime_r(&t, &info))] = 0;
|
result[strftime(result, 31, "%x %X", localtime_r(&t, &info))] = 0;
|
||||||
# endif // WIN32
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,6 @@ namespace
|
|||||||
std::streambuf *cerr_buffer;
|
std::streambuf *cerr_buffer;
|
||||||
bool run_resize_screen = false;
|
bool run_resize_screen = false;
|
||||||
|
|
||||||
# if !defined(WIN32)
|
|
||||||
void sighandler(int sig)
|
void sighandler(int sig)
|
||||||
{
|
{
|
||||||
if (sig == SIGWINCH)
|
if (sig == SIGWINCH)
|
||||||
@@ -67,7 +66,6 @@ namespace
|
|||||||
signal(sig, sighandler);
|
signal(sig, sighandler);
|
||||||
# endif // __sun && __SVR4
|
# endif // __sun && __SVR4
|
||||||
}
|
}
|
||||||
# endif // !WIN32
|
|
||||||
|
|
||||||
void do_at_exit()
|
void do_at_exit()
|
||||||
{
|
{
|
||||||
@@ -153,13 +151,11 @@ int main(int argc, char **argv)
|
|||||||
if (Config.mouse_support)
|
if (Config.mouse_support)
|
||||||
mousemask(ALL_MOUSE_EVENTS, 0);
|
mousemask(ALL_MOUSE_EVENTS, 0);
|
||||||
|
|
||||||
# ifndef WIN32
|
|
||||||
signal(SIGWINCH, sighandler);
|
signal(SIGWINCH, sighandler);
|
||||||
// we get it after connection with mpd is broken.
|
// we get it after connection with mpd is broken.
|
||||||
// just ignore it and wait for the connection to
|
// just ignore it and wait for the connection to
|
||||||
// be reestablished.
|
// be reestablished.
|
||||||
sigignore(SIGPIPE);
|
sigignore(SIGPIPE);
|
||||||
# endif // !WIN32
|
|
||||||
|
|
||||||
while (!Actions::ExitMainLoop)
|
while (!Actions::ExitMainLoop)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,12 +26,8 @@
|
|||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#include <sys/select.h>
|
||||||
# include <winsock.h>
|
#include <unistd.h>
|
||||||
#else
|
|
||||||
# include <sys/select.h>
|
|
||||||
# include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "utility/string.h"
|
#include "utility/string.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user