@@ -52,11 +52,11 @@ PyAPI_FUNC(int) _Py_EncodeLocaleEx(
5252 int current_locale ,
5353 _Py_error_handler errors );
5454
55- PyAPI_FUNC ( char * ) _Py_EncodeLocaleRaw (
55+ extern char * _Py_EncodeLocaleRaw (
5656 const wchar_t * text ,
5757 size_t * error_pos );
5858
59- PyAPI_FUNC ( PyObject * ) _Py_device_encoding (int );
59+ extern PyObject * _Py_device_encoding (int );
6060
6161#if defined(MS_WINDOWS ) || defined(__APPLE__ )
6262 /* On Windows, the count parameter of read() is an int (bpo-9015, bpo-9611).
@@ -109,24 +109,24 @@ PyAPI_FUNC(int) _Py_stat(
109109 PyObject * path ,
110110 struct stat * status );
111111
112- PyAPI_FUNC ( int ) _Py_open (
112+ extern int _Py_open (
113113 const char * pathname ,
114114 int flags );
115115
116116PyAPI_FUNC (int ) _Py_open_noraise (
117117 const char * pathname ,
118118 int flags );
119119
120- PyAPI_FUNC ( FILE * ) _Py_wfopen (
120+ extern FILE * _Py_wfopen (
121121 const wchar_t * path ,
122122 const wchar_t * mode );
123123
124- PyAPI_FUNC ( Py_ssize_t ) _Py_read (
124+ extern Py_ssize_t _Py_read (
125125 int fd ,
126126 void * buf ,
127127 size_t count );
128128
129- PyAPI_FUNC ( Py_ssize_t ) _Py_write (
129+ extern Py_ssize_t _Py_write (
130130 int fd ,
131131 const void * buf ,
132132 size_t count );
@@ -137,7 +137,7 @@ PyAPI_FUNC(Py_ssize_t) _Py_write_noraise(
137137 size_t count );
138138
139139#ifdef HAVE_READLINK
140- PyAPI_FUNC ( int ) _Py_wreadlink (
140+ extern int _Py_wreadlink (
141141 const wchar_t * path ,
142142 wchar_t * buf ,
143143 /* Number of characters of 'buf' buffer
@@ -146,21 +146,21 @@ PyAPI_FUNC(int) _Py_wreadlink(
146146#endif
147147
148148#ifdef HAVE_REALPATH
149- PyAPI_FUNC ( wchar_t * ) _Py_wrealpath (
149+ extern wchar_t * _Py_wrealpath (
150150 const wchar_t * path ,
151151 wchar_t * resolved_path ,
152152 /* Number of characters of 'resolved_path' buffer
153153 including the trailing NUL character */
154154 size_t resolved_path_len );
155155#endif
156156
157- PyAPI_FUNC ( wchar_t * ) _Py_wgetcwd (
157+ extern wchar_t * _Py_wgetcwd (
158158 wchar_t * buf ,
159159 /* Number of characters of 'buf' buffer
160160 including the trailing NUL character */
161161 size_t buflen );
162162
163- PyAPI_FUNC ( int ) _Py_get_inheritable (int fd );
163+ extern int _Py_get_inheritable (int fd );
164164
165165PyAPI_FUNC (int ) _Py_set_inheritable (int fd , int inheritable ,
166166 int * atomic_flag_works );
@@ -170,18 +170,18 @@ PyAPI_FUNC(int) _Py_set_inheritable_async_safe(int fd, int inheritable,
170170
171171PyAPI_FUNC (int ) _Py_dup (int fd );
172172
173- PyAPI_FUNC ( int ) _Py_get_blocking (int fd );
173+ extern int _Py_get_blocking (int fd );
174174
175- PyAPI_FUNC ( int ) _Py_set_blocking (int fd , int blocking );
175+ extern int _Py_set_blocking (int fd , int blocking );
176176
177177#ifdef MS_WINDOWS
178- PyAPI_FUNC ( void * ) _Py_get_osfhandle_noraise (int fd );
178+ extern void * _Py_get_osfhandle_noraise (int fd );
179179
180180PyAPI_FUNC (void * ) _Py_get_osfhandle (int fd );
181181
182- PyAPI_FUNC ( int ) _Py_open_osfhandle_noraise (void * handle , int flags );
182+ extern int _Py_open_osfhandle_noraise (void * handle , int flags );
183183
184- PyAPI_FUNC ( int ) _Py_open_osfhandle (void * handle , int flags );
184+ extern int _Py_open_osfhandle (void * handle , int flags );
185185#endif /* MS_WINDOWS */
186186
187187// This is used after getting NULL back from Py_DecodeLocale().
@@ -190,51 +190,51 @@ PyAPI_FUNC(int) _Py_open_osfhandle(void *handle, int flags);
190190 ? _PyStatus_ERR("cannot decode " NAME) \
191191 : _PyStatus_NO_MEMORY()
192192
193- PyAPI_DATA ( int ) _Py_HasFileSystemDefaultEncodeErrors ;
193+ extern int _Py_HasFileSystemDefaultEncodeErrors ;
194194
195- PyAPI_FUNC ( int ) _Py_DecodeUTF8Ex (
195+ extern int _Py_DecodeUTF8Ex (
196196 const char * arg ,
197197 Py_ssize_t arglen ,
198198 wchar_t * * wstr ,
199199 size_t * wlen ,
200200 const char * * reason ,
201201 _Py_error_handler errors );
202202
203- PyAPI_FUNC ( int ) _Py_EncodeUTF8Ex (
203+ extern int _Py_EncodeUTF8Ex (
204204 const wchar_t * text ,
205205 char * * str ,
206206 size_t * error_pos ,
207207 const char * * reason ,
208208 int raw_malloc ,
209209 _Py_error_handler errors );
210210
211- PyAPI_FUNC ( wchar_t * ) _Py_DecodeUTF8_surrogateescape (
211+ extern wchar_t * _Py_DecodeUTF8_surrogateescape (
212212 const char * arg ,
213213 Py_ssize_t arglen ,
214214 size_t * wlen );
215215
216216extern int
217217_Py_wstat (const wchar_t * , struct stat * );
218218
219- PyAPI_FUNC ( int ) _Py_GetForceASCII (void );
219+ extern int _Py_GetForceASCII (void );
220220
221221/* Reset "force ASCII" mode (if it was initialized).
222222
223223 This function should be called when Python changes the LC_CTYPE locale,
224224 so the "force ASCII" mode can be detected again on the new locale
225225 encoding. */
226- PyAPI_FUNC ( void ) _Py_ResetForceASCII (void );
226+ extern void _Py_ResetForceASCII (void );
227227
228228
229- PyAPI_FUNC ( int ) _Py_GetLocaleconvNumeric (
229+ extern int _Py_GetLocaleconvNumeric (
230230 struct lconv * lc ,
231231 PyObject * * decimal_point ,
232232 PyObject * * thousands_sep );
233233
234234PyAPI_FUNC (void ) _Py_closerange (int first , int last );
235235
236- PyAPI_FUNC ( wchar_t * ) _Py_GetLocaleEncoding (void );
237- PyAPI_FUNC ( PyObject * ) _Py_GetLocaleEncodingObjec
CDAC
t (void );
236+ extern wchar_t * _Py_GetLocaleEncoding (void );
237+ extern PyObject * _Py_GetLocaleEncodingObject (void );
238238
239239#ifdef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION
240240extern int _Py_LocaleUsesNonUnicodeWchar (void );
@@ -253,13 +253,13 @@ extern int _Py_abspath(const wchar_t *path, wchar_t **abspath_p);
253253#ifdef MS_WINDOWS
254254extern int _PyOS_getfullpathname (const wchar_t * path , wchar_t * * abspath_p );
255255#endif
256- extern wchar_t * _Py_join_relfile (const wchar_t * dirname ,
257- const wchar_t * relfile );
256+ extern wchar_t * _Py_join_relfile (const wchar_t * dirname ,
257+ const wchar_t * relfile );
258258extern int _Py_add_relfile (wchar_t * dirname ,
259259 const wchar_t * relfile ,
260260 size_t bufsize );
261261extern size_t _Py_find_basename (const wchar_t * filename );
262- PyAPI_FUNC (wchar_t * ) _Py_normpath (wchar_t * path , Py_ssize_t size );
262+ PyAPI_FUNC (wchar_t * ) _Py_normpath (wchar_t * path , Py_ssize_t size );
263263
264264// The Windows Games API family does not provide these functions
265265// so provide our own implementations. Remove them in case they get added
0 commit comments