Skip to content

Commit 157f894

Browse files
committed
don't prototype strdup() for __clang_analyzer__ case in windows builds.
Fixes: #12948. (cherry picked from commit 17bba02)
1 parent a220e7c commit 157f894

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/SDL_stdinc.h

+4
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,12 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
750750
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
751751
#endif
752752

753+
#ifndef _WIN32
753754
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
755+
/* not for windows: might conflict with string.h where strdup may have
756+
* dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */
754757
char *strdup(const char *str);
758+
#endif
755759

756760
/* Starting LLVM 16, the analyser errors out if these functions do not have
757761
their prototype defined (clang-diagnostic-implicit-function-declaration) */

0 commit comments

Comments
 (0)