[PATCH] Avoid duplicate declarations of interlocked functions
Casper Hornstrup <[email protected]>
| Newsgroups | gmane.comp.gnu.mingw.patches |
|---|---|
| Message-ID | <[email protected]> |
Is this acceptable? The problem is that Microsoft does not define the user-mode interlocked functions equal to the kernel-mode interlocked functions. 2002-07-19 Casper S. Hornstrup <[email protected]> * include/winbase.h (Interlocked*): Wrap in #ifndef __INTERLOCKED_DECLARED to avoid compile error when already defined. Index: include/winbase.h =================================================================== RCS file: /cvs/src/src/winsup/w32api/include/winbase.h,v retrieving revision 1.25 diff -u -r1.25 winbase.h --- include/winbase.h 9 Jul 2002 13:24:02 -0000 1.25 +++ include/winbase.h 19 Jul 2002 19:21:22 -0000 @@ -1305,6 +1305,8 @@ #endif BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD); BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE); +#ifndef __INTERLOCKED_DECLARED +#define __INTERLOCKED_DECLARED LONG WINAPI InterlockedCompareExchange(LPLONG,LONG,LONG); /* PVOID WINAPI InterlockedCompareExchangePointer(PVOID*,PVOID,PVOID); */ #define InterlockedCompareExchangePointer(d,e,c) \ @@ -1316,6 +1318,7 @@ (PVOID)InterlockedExchange((LPLONG)(t),(LONG)(v)) LONG WINAPI InterlockedExchangeAdd(LPLONG,LONG); LONG WINAPI InterlockedIncrement(LPLONG); +#endif /* __INTERLOCKED_DECLARED */ BOOL WINAPI IsBadCodePtr(FARPROC); BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT); BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT);
winbase-inter.diff
(text/x-diff, 1.2 KB)
2002-07-19 Casper S. Hornstrup <[email protected]> * include/winbase.h (Interlocked*): Wrap in #ifndef __INTERLOCKED_DECLARED to avoid compile error when already defined. Index: include/winbase.h =================================================================== RCS file: /cvs/src/src/winsup/w32api/include/winbase.h,v retrieving revision 1.25 diff -u -r1.25 winbase.h --- include/winbase.h 9 Jul 2002 13:24:02 -0000 1.25 +++ include/winbase.h 19 Jul 2002 19:21:22 -0000 @@ -1305,6 +1305,8 @@ #endif BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR,DWORD); BOOL WINAPI InitializeSid (PSID,PSID_IDENTIFIER_AUTHORITY,BYTE); +#ifndef __INTERLOCKED_DECLARED +#define __INTERLOCKED_DECLARED LONG WINAPI InterlockedCompareExchange(LPLONG,LONG,LONG); /* PVOID WINAPI InterlockedCompareExchangePointer(PVOID*,PVOID,PVOID); */ #define InterlockedCompareExchangePointer(d,e,c) \ @@ -1316,6 +1318,7 @@ (PVOID)InterlockedExchange((LPLONG)(t),(LONG)(v)) LONG WINAPI InterlockedExchangeAdd(LPLONG,LONG); LONG WINAPI InterlockedIncrement(LPLONG); +#endif /* __INTERLOCKED_DECLARED */ BOOL WINAPI IsBadCodePtr(FARPROC); BOOL WINAPI IsBadHugeReadPtr(PCVOID,UINT); BOOL WINAPI IsBadHugeWritePtr(PVOID,UINT);