mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
minor build fixes for win32 courtesy of Oddsock
svn path=/trunk/icecast/; revision=3029
This commit is contained in:
parent
ab0f4cdda8
commit
4327a10e45
@ -9,8 +9,10 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#else
|
#else
|
||||||
|
#include <winsock2.h>
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define strcasecmp stricmp
|
#define strcasecmp stricmp
|
||||||
|
#define strncasecmp strnicmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
@ -13,6 +13,10 @@ extern int accesslog;
|
|||||||
** feel free to add more here if needed.
|
** 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 ERROR0(y) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y)
|
||||||
#define ERROR1(y, a) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y, a)
|
#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)
|
#define ERROR2(y, a, b) log_write(errorlog, 1, CATMODULE "/" __FUNCTION__, y, a, b)
|
||||||
|
@ -8,16 +8,16 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <netdb.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#include <netdb.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#else
|
#else
|
||||||
#include <winsock.h>
|
#include <winsock2.h>
|
||||||
#define sethostent(x)
|
#define sethostent(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -24,11 +24,10 @@
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
typedef SOCKET sock_t
|
|
||||||
#else
|
|
||||||
typedef int sock_t;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef int sock_t;
|
||||||
|
|
||||||
#define SOCK_ERROR -1
|
#define SOCK_ERROR -1
|
||||||
#define SOCK_BLOCK 0
|
#define SOCK_BLOCK 0
|
||||||
#define SOCK_NONBLOCK 1
|
#define SOCK_NONBLOCK 1
|
||||||
|
2
src/os.h
2
src/os.h
@ -8,7 +8,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define PATH_DEPARATOR "\\"
|
#define PATH_SEPARATOR "\\"
|
||||||
#else
|
#else
|
||||||
#define PATH_SEPARATOR "/"
|
#define PATH_SEPARATOR "/"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <ogg/ogg.h>
|
#include <ogg/ogg.h>
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#else
|
#else
|
||||||
#include <window.h>
|
#include <winsock2.h>
|
||||||
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
@ -23,6 +24,7 @@
|
|||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
#include "log.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#else
|
||||||
|
#include <windows.h>
|
||||||
|
#include <winbase.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -38,6 +41,10 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "avl.h"
|
#include "avl.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define __FUNCTION__ __FILE__ ":" __LINE__
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CATMODULE "thread"
|
#define CATMODULE "thread"
|
||||||
#define LOG_ERROR(y) log_write(_logid, 1, CATMODULE "/" __FUNCTION__, y)
|
#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)
|
#define LOG_ERROR3(y, z1, z2, z3) log_write(_logid, 1, CATMODULE "/" __FUNCTION__, y, z1, z2, z3)
|
||||||
|
@ -4,14 +4,16 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#ifdef HAVE_STDINT_H
|
#ifdef HAVE_STDINT_H
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
|
#else
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "timing.h"
|
#include "timing.h"
|
||||||
|
@ -5,9 +5,10 @@
|
|||||||
#ifdef HAVE_STDINT_H
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
typedef int64_t __int64;
|
typedef __int64 int64_t;
|
||||||
typedef uint64_t unsigned __int64;
|
typedef unsigned __int64 uint64_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint64_t timing_get_time(void);
|
uint64_t timing_get_time(void);
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#else
|
#else
|
||||||
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user