Skip to content

Commit a438d7c

Browse files
committed
[UCRT] Add GCC compatible definition of _CRT_STDIO_INLINE
In C99 mode GCC emits global symbols for inline functions, as soon as the compilation unit contains a declaration that marks the function as "extern". A number of functions like printf are implicitly declared as extern by GCC, which seemingly cannot be disabled. This would lead to the inline function being emitted as a global symbol in every compilation unit. Using static inline prevents duplicate symbol errors.
1 parent 4ca68ff commit a438d7c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sdk/include/ucrt/corecrt_stdio_config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ _CRT_BEGIN_C_HEADER
2323
#undef _CRT_STDIO_INLINE
2424
#define _CRT_STDIO_INLINE
2525
#elif !defined _CRT_STDIO_INLINE
26+
#if defined(__GNUC__)
27+
#define _CRT_STDIO_INLINE static __inline
28+
#else
2629
#define _CRT_STDIO_INLINE __inline
30+
#endif
2731
#endif
2832

2933
#if !defined RC_INVOKED // RC has no target architecture

0 commit comments

Comments
 (0)