Derive-C
Loading...
Searching...
No Matches
zerosized.h
Go to the documentation of this file.
1#pragma once
2
4
6// on release).
7// - In gcc/clang C a struct with a zero sized array is itself zero sized.
8// - In C++ standard this is not valid, but it is supported as an extension by Clang and GCC
9// - A struct with an empty array is valid in both C and clang/GCC C++, an empty struct is only
10// valid in C
11#define DC_ZERO_SIZED(TYPE) \
12 typedef struct { \
13 char zero_sized_arr[0]; \
14 } TYPE; \
15 DC_STATIC_ASSERT(sizeof(TYPE) == 0)