ReactOS 0.4.16-dev-835-gd769f56
corecrt_stdio_config.h
Go to the documentation of this file.
1//
2// corecrt_stdio_config.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Per-module <stdio.h> configuration.
7//
8#pragma once
9
10#include <corecrt.h>
11
12#pragma warning(push)
13#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
15
17
18#if !defined _NO_CRT_STDIO_INLINE && !_CRT_FUNCTIONS_REQUIRED
19 #define _NO_CRT_STDIO_INLINE
20#endif
21
22#if defined _NO_CRT_STDIO_INLINE
23 #undef _CRT_STDIO_INLINE
24 #define _CRT_STDIO_INLINE
25#elif !defined _CRT_STDIO_INLINE
26 #if defined(__GNUC__)
27 #define _CRT_STDIO_INLINE static __inline
28 #else
29 #define _CRT_STDIO_INLINE __inline
30 #endif
31#endif
32
33#if !defined RC_INVOKED // RC has no target architecture
34 #if defined _M_IX86
35 #define _CRT_INTERNAL_STDIO_SYMBOL_PREFIX "_"
36 #elif defined _M_X64 || defined _M_ARM || defined _M_ARM64
37 #define _CRT_INTERNAL_STDIO_SYMBOL_PREFIX ""
38 #else
39 #error Unsupported architecture
40 #endif
41#endif
42
43
44
45// Predefine _CRT_STDIO_ISO_WIDE_SPECIFIERS to use ISO-conforming behavior for
46// the wide string printf and scanf functions (%s, %c, and %[] specifiers).
47//
48// Predefine _CRT_STDIO_LEGACY_WIDE_SPECIFIERS to use VC++ 2013 and earlier behavior for
49// the wide string printf and scanf functions (%s, %c, and %[] specifiers).
50//
51// Predefine _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS when building code that does
52// not use these format specifiers without a length modifier and thus can be
53// used with either the legacy (default) or the conforming mode. (This option
54// is intended for use by static libraries).
55#if !defined RC_INVOKED // _CRT_STDIO_LEGACY_WIDE_SPECIFIERS et al. are too long for rc
56 #if defined _CRT_STDIO_ISO_WIDE_SPECIFIERS
57 #if defined _CRT_STDIO_LEGACY_WIDE_SPECIFIERS
58 #error _CRT_STDIO_ISO_WIDE_SPECIFIERS and _CRT_STDIO_LEGACY_WIDE_SPECIFIERS cannot be defined together.
59 #endif
60
61 #if !defined _M_CEE_PURE
62 #pragma comment(lib, "iso_stdio_wide_specifiers")
63 #pragma comment(linker, "/include:" _CRT_INTERNAL_STDIO_SYMBOL_PREFIX "__PLEASE_LINK_WITH_iso_stdio_wide_specifiers.lib")
64 #endif
65 #elif defined _CRT_STDIO_LEGACY_WIDE_SPECIFIERS
66 #if !defined _M_CEE_PURE
67 #pragma comment(lib, "legacy_stdio_wide_specifiers")
68 #pragma comment(linker, "/include:" _CRT_INTERNAL_STDIO_SYMBOL_PREFIX "__PLEASE_LINK_WITH_legacy_stdio_wide_specifiers.lib")
69 #endif
70 #endif
71
72 #if defined __cplusplus && !defined _CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS
73 #ifdef _CRT_STDIO_ISO_WIDE_SPECIFIERS
74 #pragma detect_mismatch("_CRT_STDIO_ISO_WIDE_SPECIFIERS", "1")
75 #else
76 #pragma detect_mismatch("_CRT_STDIO_ISO_WIDE_SPECIFIERS", "0")
77 #endif
78 #endif
79#endif
80
81// If we're compiling mixed managed code, make sure these inline functions are
82// compiled as native to ensure that there is only one instance of each of the
83// function-local static variables.
84#if defined _M_CEE && !defined _M_CEE_PURE
85 #pragma managed(push, off)
86#endif
87
88#if _CRT_FUNCTIONS_REQUIRED
89 __declspec(selectany) unsigned __int64 __local_stdio_printf_options_storage;
92 __inline unsigned __int64* __CRTDECL __local_stdio_printf_options(void)
93 {
94 return &__local_stdio_printf_options_storage;
95 }
96
97 __declspec(selectany) unsigned __int64 __local_stdio_scanf_options_storage;
100 __inline unsigned __int64* __CRTDECL __local_stdio_scanf_options(void)
101 {
102 return &__local_stdio_scanf_options_storage;
103 }
104#endif
105
106#if defined _M_CEE && !defined _M_CEE_PURE
107 #pragma managed(pop)
108#endif
109
110#define _CRT_INTERNAL_LOCAL_PRINTF_OPTIONS (*__local_stdio_printf_options())
111#define _CRT_INTERNAL_LOCAL_SCANF_OPTIONS (*__local_stdio_scanf_options ())
112
113
114
115#define _CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (1ULL << 0)
116#define _CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR (1ULL << 1)
117#define _CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS (1ULL << 2)
118#define _CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (1ULL << 3)
119#define _CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (1ULL << 4)
120#define _CRT_INTERNAL_PRINTF_STANDARD_ROUNDING (1ULL << 5)
121
122
123#define _CRT_INTERNAL_SCANF_SECURECRT (1ULL << 0)
124#define _CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS (1ULL << 1)
125#define _CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY (1ULL << 2)
126
127
128
131#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
#define __inline
Definition: _wctype.cpp:15
#define __int64
Definition: basetyps.h:16
void __declspec(noinline) __cdecl _free_base(void *const block)
Definition: free_base.cpp:98
#define _Ret_notnull_
Definition: ms_sal.h:528
#define _Check_return_
Definition: no_sal2.h:60
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _CRT_INLINE_PURE_SECURITYCRITICAL_ATTRIBUTE
Definition: corecrt.h:199
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
#define __CRTDECL
Definition: yvals.h:17