1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

Prevent various redefined definitions in win32-specific code

From: Erik van Pienbroek <epienbro@fedoraproject.org>
Date: Mon, 22 Dec 2014 18:02:09 +0100
This commit is contained in:
Philipp Schafft 2014-12-24 09:16:15 +00:00 committed by Thomas B. Ruecker
parent 0dbabcc44c
commit 0b1af34f0e
8 changed files with 7 additions and 28 deletions

View File

@ -32,9 +32,6 @@
#include <netinet/in.h>
#else
#include <winsock2.h>
#define snprintf _snprintf
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
#include "compat.h"

View File

@ -47,12 +47,6 @@
#include "stats.h"
#define CATMODULE "format"
#ifdef WIN32
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define snprintf _snprintf
#endif
static int format_prepare_headers (source_t *source, client_t *client);

View File

@ -41,12 +41,6 @@
#include "format_mp3.h"
#ifdef WIN32
#define strcasecmp stricmp
#define strncasecmp strnicmp
#define snprintf _snprintf
#endif
#define CATMODULE "format-mp3"
/* Note that this seems to be 8192 in shoutcast - perhaps we want to be the

View File

@ -35,11 +35,8 @@
#else
#include <winsock2.h>
#include <windows.h>
#define fseeko fseek
#define SCN_OFF_T "ld"
#define PRI_OFF_T "ld"
#define snprintf _snprintf
#define strncasecmp _strnicmp
#ifndef S_ISREG
#define S_ISREG(mode) ((mode) & _S_IFREG)
#endif

View File

@ -21,8 +21,14 @@
#include <string.h>
#include <errno.h>
#ifdef HAVE_CURL
#include <curl/curl.h>
#endif
#ifdef WIN32
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif
/* For getpid() */
#include <process.h>
#include <windows.h>
@ -33,9 +39,6 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_CURL
#include <curl/curl.h>
#endif
#ifdef HAVE_UNAME
#include <sys/utsname.h>

View File

@ -174,7 +174,7 @@ void MD5Final(unsigned char digest[HASH_LEN], struct MD5Context *ctx)
MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memcpy(digest, ctx->buf, HASH_LEN);
memset(ctx, 0, sizeof(ctx));
memset(ctx, 0, sizeof(*ctx));
/* In case it's sensitive */
}

View File

@ -32,9 +32,6 @@
#include <netinet/in.h>
#else
#include <winsock2.h>
#define snprintf _snprintf
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
#include "compat.h"

View File

@ -31,9 +31,6 @@
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
#define snprintf _snprintf
#define strcasecmp stricmp
#define strncasecmp strnicmp
#endif
#include "common/net/sock.h"