begin_code.h: add gcc version checks to the alloc_size attributes.

main
Ozkan Sezer 2022-11-30 11:33:32 +03:00
parent 4b6390261b
commit 14b902faca
1 changed files with 6 additions and 5 deletions

View File

@ -172,16 +172,17 @@
#ifndef SDL_MALLOC
#if defined(__GNUC__)
#define SDL_MALLOC __attribute__((malloc))
// FIXME
//#elif defined(_MSC_VER)
//#define SDL_MALLOC __declspec(allocator) __desclspec(restrict)
/* FIXME
#elif defined(_MSC_VER)
#define SDL_MALLOC __declspec(allocator) __desclspec(restrict)
*/
#else
#define SDL_MALLOC
#endif
#endif /* SDL_MALLOC not defined */
#ifndef SDL_ALLOC_SIZE
#if defined(__GNUC__)
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
#define SDL_ALLOC_SIZE(p) __attribute__((alloc_size(p)))
#elif defined(_MSC_VER)
#define SDL_ALLOC_SIZE(p)
@ -191,7 +192,7 @@
#endif /* SDL_ALLOC_SIZE not defined */
#ifndef SDL_ALLOC_SIZE2
#if defined(__GNUC__)
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
#define SDL_ALLOC_SIZE2(p1, p2) __attribute__((alloc_size(p1, p2)))
#elif defined(_MSC_VER)
#define SDL_ALLOC_SIZE2(p1, p2)