The MinGW.org Windows System Libraries
リビジョン | d1b3b1693bdec6472d72b085b1e2651866472162 (tree) |
---|---|
日時 | 2017-06-21 06:41:37 |
作者 | Keith Marshall <keithmarshall@user...> |
コミッター | Keith Marshall |
Make <winnt.h> header effectively self-contained.
@@ -1,3 +1,11 @@ | ||
1 | +2017-06-20 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Make <winnt.h> header effectively self-contained. | |
4 | + | |
5 | + * include/winnt.h (_WINNT_H): Defer definition unless included via... | |
6 | + (windef.h): ...this; include it, to enforce inclusion order, then... | |
7 | + [_WINNT_H]: ...re-evaluate it, to avoid recursive inclusion loop. | |
8 | + | |
1 | 9 | 2017-06-12 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 10 | |
3 | 11 | Consolidate <winuser.h> version specific conditionals. |
@@ -31,6 +31,16 @@ | ||
31 | 31 | */ |
32 | 32 | #ifndef _WINNT_H |
33 | 33 | #pragma GCC system_header |
34 | + | |
35 | +/* For effective self-containment, <winnt.h> requires <windef.h> to have | |
36 | + * been included, BEFORE defining the _WINNT_H repeat inclusion guard... | |
37 | + */ | |
38 | +#include <windef.h> | |
39 | +/* ...but this has the unfortunate side effect that <windef.h> may then | |
40 | + * recursively include <winnt.h>; retest the inclusion guard, to break | |
41 | + * out of any ensuing recursive inclusion loop. | |
42 | + */ | |
43 | +#ifndef _WINNT_H | |
34 | 44 | #define _WINNT_H |
35 | 45 | |
36 | 46 | #include <winerror.h> |
@@ -4324,4 +4334,5 @@ static FORCEINLINE void MemoryBarrier (void) | ||
4324 | 4334 | _END_C_DECLS |
4325 | 4335 | |
4326 | 4336 | #endif /* ! RC_INVOKED */ |
4337 | +#endif /* !_WINNT_H: internal recursion break */ | |
4327 | 4338 | #endif /* !_WINNT_H: $RCSfile$: end of file */ |