From: Memphiz Date: Sat, 12 May 2012 15:24:07 +0000 (+0200) Subject: [windows] - fixups for building on windows X-Git-Tag: upstream/0.9.0~4^2~81 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=566c9bf8bfcc08b60c3cb9ae2edce8b516128203;p=deb_shairplay.git [windows] - fixups for building on windows --- diff --git a/src/lib/base64.c b/src/lib/base64.c index d1bf680..8ced900 100644 --- a/src/lib/base64.c +++ b/src/lib/base64.c @@ -32,9 +32,7 @@ struct base64_s { int skip_spaces; }; -static base64_t default_base64 = - { .charlist = DEFAULT_CHARLIST, - .use_padding = 1 }; +static base64_t default_base64 = {DEFAULT_CHARLIST, "", 0, 1, 0}; static void initialize_charmap(base64_t *base64) diff --git a/src/lib/compat.h b/src/lib/compat.h index ab32385..927fc96 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -18,6 +18,9 @@ #if defined(WIN32) #include #include +#ifndef snprintf +#define snprintf _snprintf +#endif #else #include #include diff --git a/src/lib/crypto/os_port.h b/src/lib/crypto/os_port.h index cd505b5..9a48136 100644 --- a/src/lib/crypto/os_port.h +++ b/src/lib/crypto/os_port.h @@ -44,7 +44,6 @@ extern "C" { #include #if defined(WIN32) -#define STDCALL __stdcall #define EXP_FUNC __declspec(dllexport) #else #define STDCALL diff --git a/src/lib/http_response.c b/src/lib/http_response.c index 45ccea2..49166cc 100644 --- a/src/lib/http_response.c +++ b/src/lib/http_response.c @@ -18,6 +18,7 @@ #include #include "http_response.h" +#include "compat.h" struct http_response_s { int complete; diff --git a/src/lib/netutils.c b/src/lib/netutils.c index 5399fb0..8226e4f 100644 --- a/src/lib/netutils.c +++ b/src/lib/netutils.c @@ -178,7 +178,7 @@ netutils_parse_address(int family, const char *src, void *dst, int dstlen) length = -1; for (ptr=result; ptr!=NULL; ptr=ptr->ai_next) { - if (family == ptr->ai_family && dstlen >= ptr->ai_addrlen) { + if (family == ptr->ai_family && (unsigned int)dstlen >= ptr->ai_addrlen) { memcpy(dst, ptr->ai_addr, ptr->ai_addrlen); length = ptr->ai_addrlen; break; diff --git a/src/lib/raop.c b/src/lib/raop.c index dbd6ea2..fc57fee 100644 --- a/src/lib/raop.c +++ b/src/lib/raop.c @@ -28,6 +28,7 @@ #include "utils.h" #include "netutils.h" #include "logger.h" +#include "compat.h" /* Actually 345 bytes for 2048-bit key */ #define MAX_SIGNATURE_LEN 512 diff --git a/src/lib/raop_buffer.c b/src/lib/raop_buffer.c index 38995c2..37bfa79 100644 --- a/src/lib/raop_buffer.c +++ b/src/lib/raop_buffer.c @@ -186,7 +186,7 @@ raop_buffer_init(const char *fmtp, raop_buffer_entry_t *entry = &raop_buffer->entries[i]; entry->audio_buffer_size = audio_buffer_size; entry->audio_buffer_len = 0; - entry->audio_buffer = raop_buffer->buffer+i*audio_buffer_size; + entry->audio_buffer = (char *)raop_buffer->buffer+i*audio_buffer_size; } /* Initialize ALAC decoder */