The MinGW.org Windows System Libraries
リビジョン | 828d385ccec683a0fcb47da3651dd286f187ccfe (tree) |
---|---|
日時 | 2012-09-01 00:09:46 |
作者 | Earnie Boyd <earnie@user...> |
コミッター | Earnie Boyd |
More on assuming GCC is greater than or equal to version 3.5.4 and that
GCC is the only compiler to be used for MinGW.org.
* include/winnt.h: Remove unneeded filters based on the assumptions.
(_SYSTEM_POWER_INFORMATION): Introduce filter for _WIN32_WINNT >=
Windows XP.
* include/winperf.h: Remove unneeded filters based on the assumptions.
* include/winreg.h: Ditto.
* include/winresrc.h: Ditto.
* include/winsnmp.h: Ditto.
* include/winsock.h: Ditto.
* include/winsock2.h: Ditto.
* include/winspool.h: Ditto.
* include/winsvc.h: Ditto.
* include/winuser.h: Ditto.
* include/winver.h: Ditto.
* include/ws2spi.h: Ditto.
* include/ws2tcpip.h: Ditto.
* include/wsahelp.h: Ditto.
* include/wsipx.h: Ditto.
* include/wsnetbs.h: Ditto.
@@ -1,3 +1,27 @@ | ||
1 | +2012-08-31 Earnie Boyd <earnie@users.sourceforge.net> | |
2 | + | |
3 | + More on assuming GCC is greater than or equal to version 3.5.4 and that | |
4 | + GCC is the only compiler to be used for MinGW.org. | |
5 | + | |
6 | + * include/winnt.h: Remove unneeded filters based on the assumptions. | |
7 | + (_SYSTEM_POWER_INFORMATION): Introduce filter for _WIN32_WINNT >= | |
8 | + Windows XP. | |
9 | + * include/winperf.h: Remove unneeded filters based on the assumptions. | |
10 | + * include/winreg.h: Ditto. | |
11 | + * include/winresrc.h: Ditto. | |
12 | + * include/winsnmp.h: Ditto. | |
13 | + * include/winsock.h: Ditto. | |
14 | + * include/winsock2.h: Ditto. | |
15 | + * include/winspool.h: Ditto. | |
16 | + * include/winsvc.h: Ditto. | |
17 | + * include/winuser.h: Ditto. | |
18 | + * include/winver.h: Ditto. | |
19 | + * include/ws2spi.h: Ditto. | |
20 | + * include/ws2tcpip.h: Ditto. | |
21 | + * include/wsahelp.h: Ditto. | |
22 | + * include/wsipx.h: Ditto. | |
23 | + * include/wsnetbs.h: Ditto. | |
24 | + | |
1 | 25 | 2012-08-28 Earnie Boyd <earnie@users.sourceforge.net> |
2 | 26 | |
3 | 27 | We are going to assume that MinGW is using GCC version greater than or |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINNT_H |
2 | 2 | #define _WINNT_H |
3 | -#if __GNUC__ >= 3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | /* translate GCC target defines to MS equivalents. Keep this synchronized |
8 | 6 | with windows.h. */ |
@@ -44,11 +42,7 @@ extern "C" { | ||
44 | 42 | #endif |
45 | 43 | |
46 | 44 | #ifndef DECLSPEC_ALIGN |
47 | -#ifdef __GNUC__ | |
48 | 45 | #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) |
49 | -#else | |
50 | -#define DECLSPEC_ALIGN(x) | |
51 | -#endif | |
52 | 46 | #endif |
53 | 47 | |
54 | 48 | #ifndef DECLSPEC_SELECTANY |
@@ -60,11 +54,7 @@ extern "C" { | ||
60 | 54 | #endif |
61 | 55 | |
62 | 56 | #ifndef FORCEINLINE |
63 | -#if (__GNUC__ >= 3) | |
64 | 57 | #define FORCEINLINE __inline __attribute__((always_inline)) |
65 | -#else | |
66 | -#define FORCEINLINE __inline | |
67 | -#endif | |
68 | 58 | #endif |
69 | 59 | |
70 | 60 | #ifndef C_ASSERT |
@@ -155,31 +145,26 @@ typedef HANDLE *PHANDLE,*LPHANDLE; | ||
155 | 145 | typedef DWORD LCID; |
156 | 146 | typedef PDWORD PLCID; |
157 | 147 | typedef WORD LANGID; |
158 | -#ifdef __GNUC__ | |
148 | + | |
159 | 149 | #define _HAVE_INT64 |
160 | 150 | #define _INTEGRAL_MAX_BITS 64 |
161 | 151 | #undef __int64 |
162 | 152 | #define __int64 long long |
163 | -#elif defined(__WATCOMC__) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 ) | |
164 | -#define _HAVE_INT64 | |
165 | -#endif /* __GNUC__/__WATCOMC */ | |
166 | -#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64) | |
153 | + | |
167 | 154 | typedef __int64 LONGLONG; |
168 | 155 | typedef unsigned __int64 DWORDLONG; |
169 | -#else | |
170 | -typedef double LONGLONG,DWORDLONG; | |
171 | -#endif | |
156 | + | |
172 | 157 | typedef LONGLONG *PLONGLONG; |
173 | 158 | typedef DWORDLONG *PDWORDLONG; |
174 | 159 | typedef DWORDLONG ULONGLONG,*PULONGLONG; |
175 | 160 | typedef LONGLONG USN; |
176 | -#ifdef _HAVE_INT64 | |
161 | + | |
177 | 162 | #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) |
178 | 163 | #define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b)) |
179 | 164 | #define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b)) |
180 | 165 | #define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b)) |
181 | 166 | #define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b)) |
182 | -#endif | |
167 | + | |
183 | 168 | #define ANSI_NULL '\0' |
184 | 169 | #define UNICODE_NULL L'\0' |
185 | 170 | typedef BYTE BOOLEAN,*PBOOLEAN; |
@@ -3819,7 +3804,7 @@ typedef enum _POWER_INFORMATION_LEVEL { | ||
3819 | 3804 | #if (_WIN32_WINNT >= 0x0500) |
3820 | 3805 | typedef LONG (WINAPI *PVECTORED_EXCEPTION_HANDLER)(PEXCEPTION_POINTERS); |
3821 | 3806 | #endif |
3822 | -#if 1 /* (WIN32_WINNT >= 0x0500) */ | |
3807 | +#if (WIN32_WINNT >= _WIN32_WINNT_WINXP) | |
3823 | 3808 | typedef struct _SYSTEM_POWER_INFORMATION { |
3824 | 3809 | ULONG MaxIdlenessAllowed; |
3825 | 3810 | ULONG Idleness; |
@@ -3939,8 +3924,6 @@ ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE); | ||
3939 | 3924 | #endif |
3940 | 3925 | |
3941 | 3926 | #ifdef _X86_ |
3942 | -#if defined(__GNUC__) | |
3943 | -#if (__GNUC__ >= 3) | |
3944 | 3927 | /* Support -masm=intel. */ |
3945 | 3928 | static __inline__ PVOID GetCurrentFiber(void) |
3946 | 3929 | { |
@@ -3976,42 +3959,7 @@ static __inline__ struct _TEB * NtCurrentTeb(void) | ||
3976 | 3959 | return ret; |
3977 | 3960 | } |
3978 | 3961 | |
3979 | -#else /* __GNUC__ >= 3 */ | |
3980 | -static __inline__ PVOID GetCurrentFiber(void) | |
3981 | -{ | |
3982 | - void* ret; | |
3983 | - __asm__ __volatile__ ( | |
3984 | - "movl %%fs:0x10,%0" | |
3985 | - : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */ | |
3986 | - ); | |
3987 | - return ret; | |
3988 | -} | |
3989 | - | |
3990 | -static __inline__ PVOID GetFiberData(void) | |
3991 | -{ | |
3992 | - void* ret; | |
3993 | - __asm__ __volatile__ ( | |
3994 | - "movl %%fs:0x10,%0\n\t" | |
3995 | - "movl (%0),%0" | |
3996 | - : "=r" (ret) /* allow use of reg eax,ebx,ecx,edx,esi,edi */ | |
3997 | - ); | |
3998 | - return ret; | |
3999 | -} | |
4000 | - | |
4001 | -static __inline__ struct _TEB * NtCurrentTeb(void) | |
4002 | -{ | |
4003 | - struct _TEB *ret; | |
4004 | - | |
4005 | - __asm__ __volatile__ ( | |
4006 | - "movl %%fs:0x18, %0\n" | |
4007 | - : "=r" (ret) | |
4008 | - : /* no inputs */ | |
4009 | - ); | |
4010 | - return ret; | |
4011 | -} | |
4012 | -#endif /* __GNUC__ >= 3 */ | |
4013 | - | |
4014 | -#else | |
3962 | +#else /* ! _X86_ */ | |
4015 | 3963 | |
4016 | 3964 | PVOID GetCurrentFiber(void); |
4017 | 3965 | #pragma aux GetCurrentFiber = \ |
@@ -4032,7 +3980,6 @@ struct _TEB * NtCurrentTeb(void); | ||
4032 | 3980 | value [eax] \ |
4033 | 3981 | modify [eax]; |
4034 | 3982 | |
4035 | -#endif /* __GNUC__ */ | |
4036 | 3983 | #endif /* _X86_ */ |
4037 | 3984 | |
4038 | 3985 | #if _WIN32_WINNT >= _WIN32_WINNT_VISTA |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINPERF_H |
2 | 2 | #define _WINPERF_H |
3 | -#if __GNUC__ >=3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifdef __cplusplus |
8 | 6 | extern "C" { |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINREG_H |
2 | 2 | #define _WINREG_H |
3 | -#if __GNUC__ >= 3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifndef WINADVAPI |
8 | 6 | #define WINADVAPI |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINRESRC_H |
2 | 2 | #define _WINRESRC_H |
3 | -#if __GNUC__ >=3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #define WIN32_LEAN_AND_MEAN |
8 | 6 | #include <winuser.h> |
@@ -23,9 +23,7 @@ | ||
23 | 23 | |
24 | 24 | #ifndef _WINSNMP_H |
25 | 25 | #define _WINSNMP_H |
26 | -#if __GNUC__ >= 3 | |
27 | 26 | #pragma GCC system_header |
28 | -#endif | |
29 | 27 | |
30 | 28 | #ifndef _WINDOWS_H |
31 | 29 | #include <windows.h> |
@@ -10,9 +10,7 @@ | ||
10 | 10 | |
11 | 11 | #ifndef _WINSOCK_H |
12 | 12 | #define _WINSOCK_H |
13 | -#if __GNUC__ >=3 | |
14 | 13 | #pragma GCC system_header |
15 | -#endif | |
16 | 14 | |
17 | 15 | #define _GNU_H_WINDOWS32_SOCKETS |
18 | 16 |
@@ -13,9 +13,7 @@ | ||
13 | 13 | #if !(defined _WINSOCK2_H || defined _WINSOCK_H) |
14 | 14 | #define _WINSOCK2_H |
15 | 15 | #define _WINSOCK_H /* to prevent later inclusion of winsock.h */ |
16 | -#if __GNUC__ >= 3 | |
17 | 16 | #pragma GCC system_header |
18 | -#endif | |
19 | 17 | |
20 | 18 | #define _GNU_H_WINDOWS32_SOCKETS |
21 | 19 |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINSPOOL_H |
2 | 2 | #define _WINSPOOL_H |
3 | -#if __GNUC__ >=3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifdef __cplusplus |
8 | 6 | extern "C" { |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINSVC_H |
2 | 2 | #define _WINSVC_H |
3 | -#if __GNUC__ >= 3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifndef WINADVAPI |
8 | 6 | #define WINADVAPI |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINUSER_H |
2 | 2 | #define _WINUSER_H |
3 | -#if __GNUC__ >= 3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifdef __cplusplus |
8 | 6 | extern "C" { |
@@ -552,10 +550,8 @@ extern "C" { | ||
552 | 550 | #define IS_INTRESOURCE(i) (((ULONG_PTR)(i) >> 16) == 0) |
553 | 551 | #define MAKEINTRESOURCEA(i) (LPSTR)((DWORD)((WORD)(i))) |
554 | 552 | #define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i))) |
555 | -#ifndef XFree86Server | |
556 | 553 | # define RT_CURSOR MAKEINTRESOURCE(1) |
557 | 554 | # define RT_FONT MAKEINTRESOURCE(8) |
558 | -#endif /* ndef XFree86Server */ | |
559 | 555 | #define RT_BITMAP MAKEINTRESOURCE(2) |
560 | 556 | #define RT_ICON MAKEINTRESOURCE(3) |
561 | 557 | #define RT_MENU MAKEINTRESOURCE(4) |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WINVER_H |
2 | 2 | #define _WINVER_H |
3 | -#if __GNUC__ >=3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #ifdef __cplusplus |
8 | 6 | extern "C" { |
@@ -17,9 +17,7 @@ | ||
17 | 17 | */ |
18 | 18 | #ifndef _WS2SPI_H |
19 | 19 | #define _WS2SPI_H |
20 | -#if __GNUC__ >= 3 | |
21 | 20 | #pragma GCC system_header |
22 | -#endif | |
23 | 21 | |
24 | 22 | #include <winsock2.h> |
25 | 23 |
@@ -8,9 +8,7 @@ | ||
8 | 8 | |
9 | 9 | #ifndef _WS2TCPIP_H |
10 | 10 | #define _WS2TCPIP_H |
11 | -#if __GNUC__ >=3 | |
12 | 11 | #pragma GCC system_header |
13 | -#endif | |
14 | 12 | |
15 | 13 | #if (defined _WINSOCK_H && !defined _WINSOCK2_H) |
16 | 14 | #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WSAHELP_H |
2 | 2 | #define _WSAHELP_H |
3 | -#if __GNUC__ >= 3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #include <winsock2.h> |
8 | 6 | #include <ntsecapi.h> |
@@ -3,9 +3,7 @@ | ||
3 | 3 | |
4 | 4 | #ifndef _WSIPX_H |
5 | 5 | #define _WSIPX_H |
6 | -#if __GNUC__ >=3 | |
7 | 6 | #pragma GCC system_header |
8 | -#endif | |
9 | 7 | |
10 | 8 | #ifdef __cplusplus |
11 | 9 | extern "C" { |
@@ -1,8 +1,6 @@ | ||
1 | 1 | #ifndef _WSNETBS_H |
2 | 2 | #define _WSNETBS_H |
3 | -#if __GNUC__ >=3 | |
4 | 3 | #pragma GCC system_header |
5 | -#endif | |
6 | 4 | |
7 | 5 | #define NETBIOS_NAME_LENGTH 16 |
8 | 6 | #define NETBIOS_UNIQUE_NAME 0 |