define static_assert if not done.

fixes https://github.com/gphoto/libgphoto2/issues/1145
This commit is contained in:
Marcus Meissner
2025-08-05 13:04:57 +02:00
parent 53175d9fde
commit a1e1ed9e24

View File

@@ -35,6 +35,11 @@
#include <assert.h>
/* needed for older Macs https://github.com/gphoto/libgphoto2/issues/1145 */
#ifndef static_assert
#define static_assert _Static_assert
#endif
/** Compiletime assertion for use inside a function. */
#define COMPILETIME_ASSERT(CONDITION) \
static_assert((CONDITION), #CONDITION)