Przeglądaj źródła

Use SDL_wcslen in vendored gameinput.cpp

Anonymous Maarten 1 tydzień temu
rodzic
commit
667eeb1a7e

+ 1 - 0
build-scripts/check_stdlib_usage.py

@@ -162,6 +162,7 @@ def find_symbols_in_file(file: pathlib.Path) -> int:
     allowed_extensions = [ ".c", ".cpp", ".m", ".h",  ".hpp", ".cc" ]
 
     excluded_paths = [
+        "src/core/windows/gameinput/gameinput.cpp",
         "src/stdlib",
         "src/libm",
         "src/hidapi",

+ 1 - 0
src/core/windows/gameinput/gameinput.cpp

@@ -47,6 +47,7 @@
 #define memcpy_s(DST, DST_SIZE, SRC, SRC_SIZE) SDL_memcpy(DST, SRC, SDL_min(DST_SIZE, SRC_SIZE))
 #define wcscpy_s(DST, DST_SIZE, SRC) SDL_wcslcpy(DST, SRC, DST_SIZE)
 #define wcscat_s(DST, DST_SIZE, SRC) SDL_wcslcat(DST, SRC, DST_SIZE)
+#define wcslen(S) SDL_wcslen(S)
 
 #if __cplusplus < 2011003L
 #define noexcept