Commit 008117468919727be8585a7b955a3ff4ccadd072

Pierre Wendling 2023-03-23T14:04:24

Fix clang-tidy error on LLVM 16. Starting LLVM 16, clang-diagnostic-implicit-function-declaration is treated as an error. (cherry picked from commit ea093378a29b786edbaa265045638f66d7f83d8b)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/include/SDL_stdinc.h b/include/SDL_stdinc.h
index 2099783..0b13495 100644
--- a/include/SDL_stdinc.h
+++ b/include/SDL_stdinc.h
@@ -724,6 +724,11 @@ size_t strlcpy(char* dst, const char* src, size_t size);
 size_t strlcat(char* dst, const char* src, size_t size);
 #endif
 
+/* Starting LLVM 16, the analyser errors out if these functions do not have
+   their prototype defined (clang-diagnostic-implicit-function-declaration) */
+#include <stdlib.h>
+#include <string.h>
+
 #define SDL_malloc malloc
 #define SDL_calloc calloc
 #define SDL_realloc realloc