Fixed WinAPI compilation. Ported timed mutex to waitable timer. Windows time points are now aligned with FILETIME to reduce conversion overhead when used with waitable timers.

[SVN r86192]
This commit is contained in:
Andrey Semashev
2013-10-07 17:41:43 +00:00
parent 933b2c596b
commit 0f9b39df3f
3 changed files with 32 additions and 13 deletions

View File

@@ -101,7 +101,7 @@ extern "C" {
# ifdef _WIN64
#if defined(__CYGWIN__)
typedef long INT_PTR_;
typedef unsigned long INT_PTR_;
typedef unsigned long UINT_PTR_;
typedef long LONG_PTR_;
typedef unsigned long ULONG_PTR_;
#else
@@ -112,7 +112,7 @@ extern "C" {
#endif
# else
typedef int INT_PTR_;
typedef unsigned int INT_PTR_;
typedef unsigned int UINT_PTR_;
typedef long LONG_PTR_;
typedef unsigned long ULONG_PTR_;
# endif

View File

@@ -27,26 +27,47 @@ namespace winapi
typedef ::NEARPROC NEARPROC_;
typedef ::PROC PROC_;
using ::LoadLibrary;
# ifdef BOOST_NO_ANSI_APIS
using ::LoadLibraryW;
using ::GetModuleHandleW;
# else
using ::LoadLibraryA;
using ::GetModuleHandleA;
# endif
using ::FreeLibrary;
using ::GetProcAddress;
using ::GetModuleHandleA;
#else
extern "C" {
#ifdef _WIN64
# ifdef _WIN64
typedef INT_PTR (WINAPI *FARPROC_)();
typedef INT_PTR (WINAPI *NEARPROC_)();
typedef INT_PTR (WINAPI *PROC_)();
#else
# else
typedef int (WINAPI *FARPROC_)();
typedef int (WINAPI *NEARPROC_)();
typedef int (WINAPI *PROC_)();
#endif // _WIN64
# endif // _WIN64
# ifdef BOOST_NO_ANSI_APIS
__declspec(dllimport) HMODULE_ WINAPI
LoadLibrary(
LPCTSTR_ lpFileName
LoadLibraryW(
LPCWSTR_ lpFileName
);
__declspec(dllimport) HMODULE_ WINAPI
GetModuleHandleW(
LPCWSTR_ lpFileName
);
# else
__declspec(dllimport) HMODULE_ WINAPI
LoadLibraryA(
LPCSTR_ lpFileName
);
__declspec(dllimport) HMODULE_ WINAPI
GetModuleHandleA(
LPCSTR_ lpFileName
);
# endif
__declspec(dllimport) BOOL_ WINAPI
FreeLibrary(
HMODULE_ hModule
@@ -56,10 +77,6 @@ extern "C" {
HMODULE_ hModule,
LPCSTR_ lpProcName
);
__declspec(dllimport) HMODULE_ WINAPI
GetModuleHandleA(
LPCSTR_ lpFileName
);
}
#endif
}

View File

@@ -147,6 +147,8 @@ const DWORD_ wait_failed = (DWORD_)0xFFFFFFFF;
#endif // defined( BOOST_USE_WINDOWS_H )
const DWORD_ max_non_infinite_wait = (DWORD_)0xFFFFFFFE;
BOOST_FORCEINLINE HANDLE_ create_anonymous_mutex(_SECURITY_ATTRIBUTES* lpAttributes, BOOL_ bInitialOwner)
{
#ifdef BOOST_NO_ANSI_APIS