From 4327a10e45154e928bbb169fa5ffe74555920ee3 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Thu, 7 Feb 2002 01:04:09 +0000 Subject: [PATCH] minor build fixes for win32 courtesy of Oddsock svn path=/trunk/icecast/; revision=3029 --- src/connection.c | 2 ++ src/logging.h | 4 ++++ src/net/resolver.c | 4 ++-- src/net/sock.h | 5 ++--- src/os.h | 2 +- src/source.c | 6 ++++-- src/thread/thread.c | 7 +++++++ src/timing/timing.c | 8 +++++--- src/timing/timing.h | 7 ++++--- src/util.c | 1 + 10 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/connection.c b/src/connection.c index d1620063..5292f790 100644 --- a/src/connection.c +++ b/src/connection.c @@ -9,8 +9,10 @@ #include #include #else +#include #define snprintf _snprintf #define strcasecmp stricmp +#define strncasecmp strnicmp #endif #include "os.h" diff --git a/src/logging.h b/src/logging.h index 4e6e0149..475b5cd3 100644 --- a/src/logging.h +++ b/src/logging.h @@ -13,6 +13,10 @@ extern int accesslog; ** feel free to add more here if needed. */ +#ifdef _WIN32 +#define __FUNCTION__ __FILE__ ":" __LINE__ +#endif + #define ERROR0(y) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y) #define ERROR1(y, a) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y, a) #define ERROR2(y, a, b) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y, a, b) diff --git a/src/net/resolver.c b/src/net/resolver.c index a554b044..cc2b6af3 100644 --- a/src/net/resolver.c +++ b/src/net/resolver.c @@ -8,16 +8,16 @@ #include #include #include -#include #include #ifndef _WIN32 +#include #include #include #include #include #else -#include +#include #define sethostent(x) #endif diff --git a/src/net/sock.h b/src/net/sock.h index ddb54251..f8c3337d 100644 --- a/src/net/sock.h +++ b/src/net/sock.h @@ -24,11 +24,10 @@ #ifdef _WIN32 #include -typedef SOCKET sock_t -#else -typedef int sock_t; #endif +typedef int sock_t; + #define SOCK_ERROR -1 #define SOCK_BLOCK 0 #define SOCK_NONBLOCK 1 diff --git a/src/os.h b/src/os.h index ff9c2064..fa386e43 100644 --- a/src/os.h +++ b/src/os.h @@ -8,7 +8,7 @@ #endif #ifdef _WIN32 -#define PATH_DEPARATOR "\\" +#define PATH_SEPARATOR "\\" #else #define PATH_SEPARATOR "/" #endif diff --git a/src/source.c b/src/source.c index 42f185da..21ddba20 100644 --- a/src/source.c +++ b/src/source.c @@ -1,15 +1,16 @@ #include #include #include -#include #include #include #ifndef _WIN32 +#include #include #include #else -#include +#include +#include #endif #include "thread.h" @@ -23,6 +24,7 @@ #include "client.h" #include "stats.h" #include "format.h" +#include "log.h" #include "logging.h" #include "config.h" diff --git a/src/thread/thread.c b/src/thread/thread.c index 8d64b9d3..2e1360f5 100644 --- a/src/thread/thread.c +++ b/src/thread/thread.c @@ -28,6 +28,9 @@ #ifndef _WIN32 #include #include +#else +#include +#include #endif #include @@ -38,6 +41,10 @@ #include "thread.h" #include "avl.h" +#ifdef _WIN32 +#define __FUNCTION__ __FILE__ ":" __LINE__ +#endif + #define CATMODULE "thread" #define LOG_ERROR(y) log_write(_logid, 1, CATMODULE "/" __FUNCTION__, y) #define LOG_ERROR3(y, z1, z2, z3) log_write(_logid, 1, CATMODULE "/" __FUNCTION__, y, z1, z2, z3) diff --git a/src/timing/timing.c b/src/timing/timing.c index af33d055..c1299e2b 100644 --- a/src/timing/timing.c +++ b/src/timing/timing.c @@ -4,14 +4,16 @@ #include #include -#include -#include #ifdef HAVE_STDINT_H # include #endif #ifdef _WIN32 -# include +#include +#include +#else +#include +#include #endif #include "timing.h" diff --git a/src/timing/timing.h b/src/timing/timing.h index 1febca1f..8fa181b1 100644 --- a/src/timing/timing.h +++ b/src/timing/timing.h @@ -3,11 +3,12 @@ #include #ifdef HAVE_STDINT_H -# include +#include #endif + #ifdef _WIN32 -typedef int64_t __int64; -typedef uint64_t unsigned __int64; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; #endif uint64_t timing_get_time(void); diff --git a/src/util.c b/src/util.c index 49356d38..7abc2f0e 100644 --- a/src/util.c +++ b/src/util.c @@ -5,6 +5,7 @@ #include #include #else +#include #include #endif