From fa58f69fe117640e29cefb1b699bede4d045bc2f Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 3 Mar 2018 16:35:09 +0300 Subject: Tox: - updated toxcore due to release v0.2 - removed message correction - reworked nodes update --- protocols/Tox/libtox/src/toxcore/ccompat.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'protocols/Tox/libtox/src/toxcore/ccompat.h') diff --git a/protocols/Tox/libtox/src/toxcore/ccompat.h b/protocols/Tox/libtox/src/toxcore/ccompat.h index e72e66ae58..1ceb5a5a87 100644 --- a/protocols/Tox/libtox/src/toxcore/ccompat.h +++ b/protocols/Tox/libtox/src/toxcore/ccompat.h @@ -4,13 +4,6 @@ #ifndef CCOMPAT_H #define CCOMPAT_H -// Marking GNU extensions to avoid warnings. -#if defined(__GNUC__) -#define GNU_EXTENSION __extension__ -#else -#define GNU_EXTENSION -#endif - // Variable length arrays. // VLA(type, name, size) allocates a variable length array with automatic // storage duration. VLA_SIZE(name) evaluates to the runtime size of that array @@ -20,7 +13,7 @@ // "function") is used. Note the semantic difference: alloca'd memory does not // get freed at the end of the declaration's scope. Do not use VLA() in loops or // you may run out of stack space. -#if !defined(_MSC_VER) && __STDC_VERSION__ >= 199901L +#if !defined(_MSC_VER) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99 VLAs. #define VLA(type, name, size) type name[size] #define SIZEOF_VLA sizeof @@ -29,6 +22,11 @@ // Emulation using alloca. #ifdef _WIN32 #include +#elif defined(__FreeBSD__) +#include +#if !defined(alloca) && defined(__GNUC__) +#define alloca __builtin_alloca +#endif #else #include #endif @@ -40,4 +38,14 @@ #endif +#ifndef __cplusplus +#define nullptr NULL +#endif + +#ifdef __GNUC__ +#define GNU_PRINTF __attribute__((__format__(__printf__, 6, 7))) +#else +#define GNU_PRINTF +#endif + #endif /* CCOMPAT_H */ -- cgit v1.2.3