fix: ignore unused variables in the array macros

This commit is contained in:
Amaan Qureshi 2024-02-26 13:39:34 -05:00
parent 721eca2394
commit a31f084b1b

View file

@ -13,6 +13,16 @@ extern "C" {
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
#pragma warning(disable : 4101)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"
#endif
#define Array(T) \
struct { \
T *contents; \
@ -265,6 +275,14 @@ static inline void _array__splice(Array *self, size_t element_size,
/// parameter by reference in order to work with the generic sorting function above.
#define compare_int(a, b) ((int)*(a) - (int)(b))
#ifdef _MSC_VER
#pragma warning(default : 4101)
#elif defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
#ifdef __cplusplus
}
#endif