Skip to content

Commit c4c3dc5

Browse files
committed
Base: reorder includes for Windows (NFCI)
This reorders the Windows header includes for `LARGE_INTEGER` after PR swiftlang#2612.
1 parent 307df29 commit c4c3dc5

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

CoreFoundation/Base.subproj/CoreFoundation_Prefix.h

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,33 @@ typedef char * Class;
6868
#include <pthread.h>
6969
#endif
7070

71+
#if TARGET_OS_WIN32
72+
#define BOOL WINDOWS_BOOL
73+
74+
#define MAXPATHLEN MAX_PATH
75+
#undef MAX_PATH
76+
#undef INVALID_HANDLE_VALUE
77+
78+
#define WIN32_LEAN_AND_MEAN
79+
80+
#ifndef WINVER
81+
#define WINVER 0x0601
82+
#endif
83+
84+
#ifndef _WIN32_WINNT
85+
#define _WIN32_WINNT 0x0601
86+
#endif
87+
88+
// The order of these includes is important
89+
#define FD_SETSIZE 1024
90+
#include <winsock2.h>
91+
#include <windows.h>
92+
#include <time.h>
93+
94+
#undef BOOL
95+
96+
#endif
97+
7198

7299
/* This macro creates some helper functions which are useful in dealing with libdispatch:
73100
* __ PREFIX Queue -- manages and returns a singleton serial queue
@@ -261,10 +288,6 @@ CF_INLINE size_t malloc_size(void *memblock) {
261288

262289
#if TARGET_OS_WIN32
263290

264-
#define MAXPATHLEN MAX_PATH
265-
#undef MAX_PATH
266-
#undef INVALID_HANDLE_VALUE
267-
268291
// Defined for source compatibility
269292
#define ino_t _ino_t
270293
#define off_t _off_t
@@ -291,26 +314,6 @@ CF_EXPORT int _NS_chdir(const char *name);
291314
CF_EXPORT int _NS_mkstemp(char *name, int bufSize);
292315
CF_EXPORT int _NS_access(const char *name, int amode);
293316

294-
#define BOOL WINDOWS_BOOL
295-
296-
#define WIN32_LEAN_AND_MEAN
297-
298-
#ifndef WINVER
299-
#define WINVER 0x0601
300-
#endif
301-
302-
#ifndef _WIN32_WINNT
303-
#define _WIN32_WINNT 0x0601
304-
#endif
305-
306-
// The order of these includes is important
307-
#define FD_SETSIZE 1024
308-
#include <winsock2.h>
309-
#include <windows.h>
310-
#include <time.h>
311-
312-
#undef BOOL
313-
314317
#define __PRETTY_FUNCTION__ __FUNCTION__
315318

316319
#define malloc_default_zone() (void *)0

0 commit comments

Comments
 (0)