diff options
author | Alex Richardson <arichardson@FreeBSD.org> | 2023-09-10 21:49:36 -0700 |
---|---|---|
committer | Alex Richardson <arichardson@FreeBSD.org> | 2023-09-12 22:15:18 -0700 |
commit | 5acc34b51625676f8f297516e4f7915b18dd4cb2 (patch) | |
tree | 97fae6352d91c60bffddb32fc305af714cbb13ce | |
parent | aec9d7266777e0b9243ef0f112fe0e07256bd446 (diff) |
Allow building with clang after aec9d7266777e0b9243ef0f112fe0e07256bd446
Clang also supports the malloc attribute but unlike GCC does not accept
the deallocator argument. This has been reported as
https://github.com/llvm/llvm-project/issues/51607
Signed-off-by: Alex Richardson <arichardson@FreeBSD.org>
-rw-r--r-- | include/X11/Xauth.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/X11/Xauth.h b/include/X11/Xauth.h index bd558eb..51e913f 100644 --- a/include/X11/Xauth.h +++ b/include/X11/Xauth.h @@ -78,7 +78,12 @@ _XFUNCPROTOBEGIN #endif #if __has_attribute(malloc) -# define XAU_MALLOC_ATTRIBUTE(X) __attribute__((malloc X)) +# if defined(__clang__) +/* Clang does not support the optional deallocator argument */ +# define XAU_MALLOC_ATTRIBUTE(X) __attribute__((malloc)) +# else +# define XAU_MALLOC_ATTRIBUTE(X) __attribute__((malloc X)) +# endif #else # define XAU_MALLOC_ATTRIBUTE(X) #endif |