浏览代码

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)
Pierre Wendling 2 年之前
父节点
当前提交
0081174689
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      include/SDL_stdinc.h

+ 5 - 0
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);
 size_t strlcat(char* dst, const char* src, size_t size);
 #endif
 #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_malloc malloc
 #define SDL_calloc calloc
 #define SDL_calloc calloc
 #define SDL_realloc realloc
 #define SDL_realloc realloc