Do not use __attribute__((malloc(free))) with Clang

This extension is not implemented by Clang.
This commit is contained in:
Marco d'Itri 2023-11-05 00:58:10 +01:00
parent 18145364ab
commit e2b38d570b

View File

@ -17,13 +17,16 @@
/* Portability macros */
#ifdef __GNUC__
# define NORETURN __attribute__((noreturn))
# define MALLOC_FREE __attribute__((malloc(free)))
# define NONNULL __attribute__((returns_nonnull))
#else
# define NORETURN
# define MALLOC_FREE
# define NONNULL
#endif
#if defined __GNUC__ && !defined __clang__
# define MALLOC_FREE __attribute__((malloc(free)))
#else
# define MALLOC_FREE
#endif
#ifndef AI_IDN
# define AI_IDN 0