July 29, 2021 8:54 PM, "Chip Davis" cdavis@codeweavers.com wrote:
Neither MinGW's nor Microsoft's <windows.h> includes <stddef.h>, either directly or indirectly.
Fixes cross compilation errors related to using offsetof(3).
Signed-off-by: Chip Davis cdavis@codeweavers.com
tests/d3d12_crosstest.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/d3d12_crosstest.h b/tests/d3d12_crosstest.h index 43af375..0b77bde 100644 --- a/tests/d3d12_crosstest.h +++ b/tests/d3d12_crosstest.h @@ -52,6 +52,7 @@ typedef int HRESULT; #include <inttypes.h> #include <limits.h> #include <math.h> +#include <stddef.h> #include <time.h>
#ifdef _WIN32
2.31.1
To answer Henri's question: I'm using somewhat ancient Clang 10.0 that was compiled from Git. This is the error I see building crosstests:
tests/d3d12.c:23900:13: warning: implicit declaration of function 'offsetof' is invalid in C99 [-Wimplicit-function-declaration] offsetof(struct argument_data, dispatch), NULL, 0); ^ tests/d3d12.c:23900:22: error: expected expression offsetof(struct argument_data, dispatch), NULL, 0); ^ tests/d3d12.c:23900:44: error: use of undeclared identifier 'dispatch' offsetof(struct argument_data, dispatch), NULL, 0); ^ tests/d3d12.c:23931:22: error: expected expression offsetof(struct argument_data, indexed_draws), NULL, 0); ^ tests/d3d12.c:23931:44: error: use of undeclared identifier 'indexed_draws' offsetof(struct argument_data, indexed_draws), NULL, 0); ^ tests/d3d12.c:23960:22: error: expected expression offsetof(struct argument_data, indexed_draws), count_buffer... ^ tests/d3d12.c:23960:44: error: use of undeclared identifier 'indexed_draws' offsetof(struct argument_data, indexed_draws), count_buffer... ^ 1 warning and 6 errors generated.
Chip