player: reorganize compatibility checks

The current layout of the compatibility checks makes is a bit
tricky to reuse parts of a platforms quirk-arounds when adding
compiler-support.

Reorganize into three sections:
- inline support
- CRT features
- socket-stack
This commit is contained in:
Erik Faye-Lund 2011-03-17 00:36:32 +01:00
parent 4c8769c630
commit dbe3cc7dcf

View File

@ -5,16 +5,27 @@
#ifndef SYNC_BASE_H #ifndef SYNC_BASE_H
#define SYNC_BASE_H #define SYNC_BASE_H
#ifdef _MSC_VER /* configure inline keyword */
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
#if defined(_MSC_VER) || defined(__GNUC__)
#define inline __inline #define inline __inline
#else
/* compiler does not support inline, make function static instead */
#define inline static
#endif
#endif
/* configure lacking CRT features */
#ifdef _MSC_VER
#define strdup _strdup #define strdup _strdup
#define snprintf _snprintf #define snprintf _snprintf
/* int is 32-bit for both x86 and x64 */
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
#elif defined(__GNUC__) #elif defined(__GNUC__)
#define inline __inline
#include <stdint.h> #include <stdint.h>
#endif #endif
/* configure socket-stack */
#ifdef _WIN32 #ifdef _WIN32
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define NOMINMAX #define NOMINMAX