Skip to content

Commit ffd6975

Browse files
committed
[UCRT] Fix non-standard extern "C" usage
1 parent 9ed5151 commit ffd6975

27 files changed

+104
-102
lines changed

sdk/lib/ucrt/conio/cgets.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
extern "C" extern intptr_t __dcrt_lowio_console_input_handle;
14+
extern "C" { extern intptr_t __dcrt_lowio_console_input_handle; }
1515

1616

1717

@@ -20,8 +20,8 @@ extern "C" extern intptr_t __dcrt_lowio_console_input_handle;
2020
// character buffer and the unicode character is not converted to single byte
2121
// MBC, then _cget_s should buffer that character so that next call to
2222
// _cgetws_s can return the same character.
23-
extern "C" extern wchar_t __console_wchar_buffer;
24-
extern "C" extern int __console_wchar_buffer_used;
23+
extern "C" { extern wchar_t __console_wchar_buffer; }
24+
extern "C" { extern int __console_wchar_buffer_used; }
2525

2626

2727

sdk/lib/ucrt/conio/cgetws.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// character buffer and the unicode character is not converted to single byte
1616
// MBC, then _cget_s should buffer that character so that next call to
1717
// _cgetws_s can return the same character.
18-
extern "C" wchar_t __console_wchar_buffer = 0;
19-
extern "C" int __console_wchar_buffer_used = 0;
18+
extern "C" { wchar_t __console_wchar_buffer = 0; }
19+
extern "C" { int __console_wchar_buffer_used = 0; }
2020

2121

2222

sdk/lib/ucrt/conio/getch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static int get_next_getch_pushback_buffer()
229229
return ret_val;
230230
}
231231

232-
extern "C" extern intptr_t __dcrt_lowio_console_input_handle;
232+
extern "C" intptr_t __dcrt_lowio_console_input_handle;
233233

234234
extern "C" CharPair const* __cdecl _getextendedkeycode(KEY_EVENT_RECORD*);
235235
extern "C" int __cdecl _kbhit_nolock();

sdk/lib/ucrt/conio/getwch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace
2727

2828
static wint_t wchbuf = WEOF; // The push-back buffer
2929

30-
extern "C" extern intptr_t __dcrt_lowio_console_input_handle;
30+
extern "C" intptr_t __dcrt_lowio_console_input_handle;
3131

3232
extern "C" CharPair const* __cdecl _getextendedkeycode(KEY_EVENT_RECORD*);
3333

sdk/lib/ucrt/convert/_wctype.cpp

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,158 +14,158 @@
1414

1515

1616

17-
extern "C" extern __inline int (__cdecl _isleadbyte_l)(int const c, _locale_t const locale)
17+
extern "C" __inline int (__cdecl _isleadbyte_l)(int const c, _locale_t const locale)
1818
{
1919
_LocaleUpdate locale_update(locale);
2020
return __acrt_locale_get_ctype_array_value(locale_update.GetLocaleT()->locinfo->_public._locale_pctype, c, _LEADBYTE);
2121
}
2222

23-
extern "C" extern __inline int (__cdecl isleadbyte)(int const c)
23+
extern "C" __inline int (__cdecl isleadbyte)(int const c)
2424
{
2525
return (_isleadbyte_l)(c, nullptr);
2626
}
2727

28-
extern "C" extern __inline int (__cdecl _iswalpha_l)(wint_t const c, _locale_t)
28+
extern "C" __inline int (__cdecl _iswalpha_l)(wint_t const c, _locale_t)
2929
{
3030
return iswalpha(c);
3131
}
3232

33-
extern "C" extern __inline int (__cdecl iswalpha)(wint_t const c)
33+
extern "C" __inline int (__cdecl iswalpha)(wint_t const c)
3434
{
3535
return iswalpha(c);
3636
}
3737

38-
extern "C" extern __inline int (__cdecl _iswupper_l)(wint_t const c, _locale_t)
38+
extern "C" __inline int (__cdecl _iswupper_l)(wint_t const c, _locale_t)
3939
{
4040
return iswupper(c);
4141
}
4242

43-
extern "C" extern __inline int (__cdecl iswupper)(wint_t const c)
43+
extern "C" __inline int (__cdecl iswupper)(wint_t const c)
4444
{
4545
return iswupper(c);
4646
}
4747

48-
extern "C" extern __inline int (__cdecl _iswlower_l)(wint_t const c, _locale_t)
48+
extern "C" __inline int (__cdecl _iswlower_l)(wint_t const c, _locale_t)
4949
{
5050
return iswlower(c);
5151
}
5252

53-
extern "C" extern __inline int (__cdecl iswlower)(wint_t const c)
53+
extern "C" __inline int (__cdecl iswlower)(wint_t const c)
5454
{
5555
return iswlower(c);
5656
}
5757

58-
extern "C" extern __inline int (__cdecl _iswdigit_l)(wint_t const c, _locale_t)
58+
extern "C" __inline int (__cdecl _iswdigit_l)(wint_t const c, _locale_t)
5959
{
6060
return iswdigit(c);
6161
}
6262

63-
extern "C" extern __inline int (__cdecl iswdigit)(wint_t const c)
63+
extern "C" __inline int (__cdecl iswdigit)(wint_t const c)
6464
{
6565
return iswdigit(c);
6666
}
6767

68-
extern "C" extern __inline int (__cdecl _iswxdigit_l)(wint_t const c, _locale_t)
68+
extern "C" __inline int (__cdecl _iswxdigit_l)(wint_t const c, _locale_t)
6969
{
7070
return iswxdigit(c);
7171
}
7272

73-
extern "C" extern __inline int (__cdecl iswxdigit)(wint_t const c)
73+
extern "C" __inline int (__cdecl iswxdigit)(wint_t const c)
7474
{
7575
return iswxdigit(c);
7676
}
7777

78-
extern "C" extern __inline int (__cdecl _iswspace_l)(wint_t const c, _locale_t)
78+
extern "C" __inline int (__cdecl _iswspace_l)(wint_t const c, _locale_t)
7979
{
8080
return iswspace(c);
8181
}
8282

83-
extern "C" extern __inline int (__cdecl iswspace)(wint_t const c)
83+
extern "C" __inline int (__cdecl iswspace)(wint_t const c)
8484
{
8585
return iswspace(c);
8686
}
8787

88-
extern "C" extern __inline int (__cdecl _iswpunct_l)(wint_t const c, _locale_t)
88+
extern "C" __inline int (__cdecl _iswpunct_l)(wint_t const c, _locale_t)
8989
{
9090
return iswpunct(c);
9191
}
9292

93-
extern "C" extern __inline int (__cdecl iswpunct)(wint_t const c)
93+
extern "C" __inline int (__cdecl iswpunct)(wint_t const c)
9494
{
9595
return iswpunct(c);
9696
}
9797

98-
extern "C" extern __inline int (__cdecl _iswblank_l)(wint_t const c, _locale_t)
98+
extern "C" __inline int (__cdecl _iswblank_l)(wint_t const c, _locale_t)
9999
{
100100
return iswblank(c);
101101
}
102102

103-
extern "C" extern __inline int (__cdecl iswblank)(wint_t const c)
103+
extern "C" __inline int (__cdecl iswblank)(wint_t const c)
104104
{
105105
return iswblank(c);
106106
}
107107

108-
extern "C" extern __inline int (__cdecl _iswalnum_l)(wint_t const c, _locale_t)
108+
extern "C" __inline int (__cdecl _iswalnum_l)(wint_t const c, _locale_t)
109109
{
110110
return iswalnum(c);
111111
}
112112

113-
extern "C" extern __inline int (__cdecl iswalnum)(wint_t const c)
113+
extern "C" __inline int (__cdecl iswalnum)(wint_t const c)
114114
{
115115
return iswalnum(c);
116116
}
117117

118-
extern "C" extern __inline int (__cdecl _iswprint_l)(wint_t const c, _locale_t)
118+
extern "C" __inline int (__cdecl _iswprint_l)(wint_t const c, _locale_t)
119119
{
120120
return iswprint(c);
121121
}
122122

123-
extern "C" extern __inline int (__cdecl iswprint)(wint_t const c)
123+
extern "C" __inline int (__cdecl iswprint)(wint_t const c)
124124
{
125125
return iswprint(c);
126126
}
127127

128-
extern "C" extern __inline int (__cdecl _iswgraph_l)(wint_t const c, _locale_t)
128+
extern "C" __inline int (__cdecl _iswgraph_l)(wint_t const c, _locale_t)
129129
{
130130
return iswgraph(c);
131131
}
132132

133-
extern "C" extern __inline int (__cdecl iswgraph)(wint_t const c)
133+
extern "C" __inline int (__cdecl iswgraph)(wint_t const c)
134134
{
135135
return iswgraph(c);
136136
}
137137

138-
extern "C" extern __inline int (__cdecl _iswcntrl_l)(wint_t const c, _locale_t)
138+
extern "C" __inline int (__cdecl _iswcntrl_l)(wint_t const c, _locale_t)
139139
{
140140
return iswcntrl(c);
141141
}
142142

143-
extern "C" extern __inline int (__cdecl iswcntrl)(wint_t const c)
143+
extern "C" __inline int (__cdecl iswcntrl)(wint_t const c)
144144
{
145145
return iswcntrl(c);
146146
}
147147

148-
extern "C" extern __inline int (__cdecl iswascii)(wint_t const c)
148+
extern "C" __inline int (__cdecl iswascii)(wint_t const c)
149149
{
150150
return iswascii(c);
151151
}
152152

153-
extern "C" extern __inline int (__cdecl _iswcsym_l)(wint_t const c, _locale_t)
153+
extern "C" __inline int (__cdecl _iswcsym_l)(wint_t const c, _locale_t)
154154
{
155155
return __iswcsym(c);
156156
}
157157

158-
extern "C" extern __inline int (__cdecl __iswcsym)(wint_t const c)
158+
extern "C" __inline int (__cdecl __iswcsym)(wint_t const c)
159159
{
160160
return __iswcsym(c);
161161
}
162162

163-
extern "C" extern __inline int (__cdecl _iswcsymf_l)(wint_t const c, _locale_t)
163+
extern "C" __inline int (__cdecl _iswcsymf_l)(wint_t const c, _locale_t)
164164
{
165165
return __iswcsymf(c);
166166
}
167167

168-
extern "C" extern __inline int (__cdecl __iswcsymf)(wint_t const c)
168+
extern "C" __inline int (__cdecl __iswcsymf)(wint_t const c)
169169
{
170170
return __iswcsymf(c);
171171
}

sdk/lib/ucrt/convert/fp_flags.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Public data used by the floating point library
77
//
88

9-
extern "C" int __fastflag{0};
9+
extern "C" { int __fastflag{0}; }
1010

1111

1212

sdk/lib/ucrt/heap/debug_heap.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ static long __acrt_current_request_number{1};
141141
#undef _crtDbgFlag
142142
#undef _crtBreakAlloc
143143

144-
extern "C" int _crtDbgFlag{_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_DEFAULT_DF};
145-
extern "C" long _crtBreakAlloc{-1};
146-
extern "C" _CRT_DUMP_CLIENT _pfnDumpClient{nullptr};
144+
extern "C" {
145+
int _crtDbgFlag{_CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_DEFAULT_DF};
146+
long _crtBreakAlloc{-1};
147+
_CRT_DUMP_CLIENT _pfnDumpClient{nullptr};
148+
}
147149

148150
extern "C" int* __p__crtDbgFlag()
149151
{

sdk/lib/ucrt/heap/debug_heap_hook.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ extern "C" int __cdecl _CrtDefaultAllocHook(
3737
return 1; // Allow all heap operations
3838
}
3939

40-
extern "C" _CRT_ALLOC_HOOK _pfnAllocHook = _CrtDefaultAllocHook;
40+
extern "C" { _CRT_ALLOC_HOOK _pfnAllocHook = _CrtDefaultAllocHook; }

sdk/lib/ucrt/heap/heap_handle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// The CRT heap handle. This global variable is modified only during CRT
1414
// startup and CRT shutdown.
15-
extern "C" HANDLE __acrt_heap = nullptr;
15+
extern "C" { HANDLE __acrt_heap = nullptr; }
1616

1717

1818

sdk/lib/ucrt/inc/corecrt_internal_stdio.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@ auto __acrt_lock_stream_and_call(FILE* const stream, Action&& action) throw()
307307
* the number of stdio-level files which may be open simultaneously. This
308308
* is normally set to _NSTREAM_ by the stdio initialization code.
309309
*/
310-
extern "C" extern int _nstream;
310+
extern "C" int _nstream;
311311

312312
/*
313313
* Pointer to the array of pointers to FILE structures that are used
314314
* to manage stdio-level files.
315315
*/
316-
extern "C" extern __crt_stdio_stream_data** __piob;
316+
extern "C" __crt_stdio_stream_data** __piob;
317317

318318
// __acrt_stdio_is_initialized cannot be with the rest of
319319
// stdio initialization logic since referencing those symbols

0 commit comments

Comments
 (0)