Skip to content

Commit 06a13f8

Browse files
Issue python#23152: Move declarations back to posixmodule.c.
Declarations of Windows-specific auxilary functions need Windows types from windows.h. Instead of including windows.h in Python.h and making it available to all Windows users, it is simpler and safer just move declarations to the single file that needs them.
1 parent 12ebbc7 commit 06a13f8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Include/fileutils.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ struct _Py_stat_struct {
4242
int st_ctime_nsec;
4343
unsigned long st_file_attributes;
4444
};
45-
46-
PyAPI_FUNC(void) _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
47-
PyAPI_FUNC(void) _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
48-
ULONG, struct _Py_stat_struct *);
4945
#else
5046
# define _Py_stat_struct stat
5147
#endif

Modules/posixmodule.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,12 @@ static int win32_can_symlink = 0;
372372

373373
#define DWORD_MAX 4294967295U
374374

375+
#ifdef MS_WINDOWS
376+
/* defined in fileutils.c */
377+
PyAPI_FUNC(void) _Py_time_t_to_FILE_TIME(time_t, int, FILETIME *);
378+
PyAPI_FUNC(void) _Py_attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *,
379+
ULONG, struct _Py_stat_struct *);
380+
#endif
375381

376382
#ifdef MS_WINDOWS
377383
static int

0 commit comments

Comments
 (0)