From dbe3cc7dcff4d730d92779ff993a77b272046852 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 17 Mar 2011 00:36:32 +0100 Subject: [PATCH] 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 --- sync/base.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/sync/base.h b/sync/base.h index bc46b00..8eab00a 100644 --- a/sync/base.h +++ b/sync/base.h @@ -5,16 +5,27 @@ #ifndef SYNC_BASE_H #define SYNC_BASE_H +/* configure inline keyword */ +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) || defined(__GNUC__) + #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 inline __inline #define strdup _strdup #define snprintf _snprintf + /* int is 32-bit for both x86 and x64 */ typedef unsigned int uint32_t; #elif defined(__GNUC__) - #define inline __inline #include #endif +/* configure socket-stack */ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #define NOMINMAX