From bd9ccb8c47e6a021ebd67fca1ba832e4bb0d387f Mon Sep 17 00:00:00 2001 From: Björn Svensson Date: Wed, 14 Sep 2022 22:36:10 +0200 Subject: Use __attribute__ when building with clang on windows Since clang supports __attribute__ we can avoid disabling it and use packed sdshdr structs. This also make sure we dont affect subsequent header files that require __attribute__. Note: Clang attempts to be compatible with MSVC and defines _MSC_VER --- sds.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sds.h b/sds.h index eda8833..d9b6761 100644 --- a/sds.h +++ b/sds.h @@ -35,9 +35,11 @@ #define SDS_MAX_PREALLOC (1024*1024) #ifdef _MSC_VER -#define __attribute__(x) typedef long long ssize_t; #define SSIZE_MAX (LLONG_MAX >> 1) +#ifndef __clang__ +#define __attribute__(x) +#endif #endif #include -- cgit v1.2.3