Skip to content

Commit db30828

Browse files
committed
[win] Consolidate windows.h include tips and tricks
1 parent f26d59d commit db30828

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

src/hb-atomic-private.hh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@
4444

4545
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
4646

47-
#define WIN32_LEAN_AND_MEAN
48-
#ifndef _WIN32_WINNT
49-
#define _WIN32_WINNT 0x0600
50-
#endif
5147
#include <windows.h>
5248

5349
/* MinGW has a convoluted history of supporting MemoryBarrier

src/hb-mutex-private.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444

4545
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
4646

47-
#define WIN32_LEAN_AND_MEAN
4847
#include <windows.h>
4948
typedef CRITICAL_SECTION hb_mutex_impl_t;
5049
#define HB_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 }

src/hb-private.hh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@
116116
#define HB_FUNC __func__
117117
#endif
118118

119+
#ifdef _WIN32
120+
/* We need Windows Vista for both Uniscribe backend and for
121+
* MemoryBarrier. We don't support compiling on Windows XP,
122+
* though we run on it fine. */
123+
# if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
124+
# undef _WIN32_WINNT
125+
# endif
126+
# ifndef _WIN32_WINNT
127+
# define _WIN32_WINNT 0x0600
128+
# endif
129+
# define WIN32_LEAN_AND_MEAN
130+
#endif
119131

120132

121133
/* Basics */

src/hb-uniscribe.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
* Google Author(s): Behdad Esfahbod
2525
*/
2626

27-
#define _WIN32_WINNT 0x0600
28-
#define WIN32_LEAN_AND_MEAN
29-
3027
#define HB_SHAPER uniscribe
3128
#include "hb-shaper-impl-private.hh"
3229

src/hb-uniscribe.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
#include "hb.h"
3131

32-
#ifndef _WIN32_WINNT
33-
#define _WIN32_WINNT 0x0600
34-
#endif
3532
#include <windows.h>
3633

3734
HB_BEGIN_DECLS

0 commit comments

Comments
 (0)