Skip to content

Commit 17bba02

Browse files
sezeroslouken
authored andcommitted
don't prototype strdup() for __clang_analyzer__ case in windows builds.
Fixes: #12948.
1 parent 15c6acf commit 17bba02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/SDL3/SDL_stdinc.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5974,8 +5974,12 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t size);
59745974
size_t wcslcat(wchar_t *dst, const wchar_t *src, size_t size);
59755975
#endif
59765976

5977+
#ifndef _WIN32
59775978
/* strdup is not ANSI but POSIX, and its prototype might be hidden... */
5979+
/* not for windows: might conflict with string.h where strdup may have
5980+
* dllimport attribute: https://github.com/libsdl-org/SDL/issues/12948 */
59785981
char *strdup(const char *str);
5982+
#endif
59795983

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

0 commit comments

Comments
 (0)