mirror of
https://github.com/boostorg/detail.git
synced 2025-07-30 04:17:14 +02:00
Boost.Chrono: Added detail/win files used by Boost.Chrono to manage with HEAADER_ONLY libs
[SVN r67749]
This commit is contained in:
25
include/boost/detail/win/GetCurrentProcess.hpp
Normal file
25
include/boost/detail/win/GetCurrentProcess.hpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// GetCurrentProcess.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_GETCURRENTPROCESS_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetCurrentProcess;
|
||||||
|
#else
|
||||||
|
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentProcess();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
26
include/boost/detail/win/GetCurrentThread.hpp
Normal file
26
include/boost/detail/win/GetCurrentThread.hpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// GetCurrentThread.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_GETCURRENTTHREAD_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetCurrentThread;
|
||||||
|
#else
|
||||||
|
extern "C" __declspec(dllimport) HANDLE_ WINAPI GetCurrentThread();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
27
include/boost/detail/win/GetLastError.hpp
Normal file
27
include/boost/detail/win/GetLastError.hpp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// GetLastError.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_GETLASTERROR_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetLastError;
|
||||||
|
#else
|
||||||
|
extern "C" __declspec(dllimport) DWORD_ WINAPI
|
||||||
|
GetLastError();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
33
include/boost/detail/win/GetProcessTimes.hpp
Normal file
33
include/boost/detail/win/GetProcessTimes.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// GetProcessTimes.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/time.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetProcessTimes;
|
||||||
|
#else
|
||||||
|
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||||
|
GetProcessTimes(
|
||||||
|
HANDLE_ hProcess,
|
||||||
|
LPFILETIME_ lpCreationTime,
|
||||||
|
LPFILETIME_ lpExitTime,
|
||||||
|
LPFILETIME_ lpKernelTime,
|
||||||
|
LPFILETIME_ lpUserTime
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_GETPROCESSTIMES_HPP
|
33
include/boost/detail/win/GetThreadTimes.hpp
Normal file
33
include/boost/detail/win/GetThreadTimes.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// GetThreadTimes.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/time.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetThreadTimes;
|
||||||
|
#else
|
||||||
|
extern "C" __declspec(dllimport) BOOL_ WINAPI
|
||||||
|
GetThreadTimes(
|
||||||
|
HANDLE_ hThread,
|
||||||
|
LPFILETIME_ lpCreationTime,
|
||||||
|
LPFILETIME_ lpExitTime,
|
||||||
|
LPFILETIME_ lpKernelTime,
|
||||||
|
LPFILETIME_ lpUserTime
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_GETTHREADTIMES_HPP
|
29
include/boost/detail/win/LocalFree.hpp
Normal file
29
include/boost/detail/win/LocalFree.hpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// LocalFree.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_LOCALFREE_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_LOCALFREE_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef HANDLE_ HLOCAL_;
|
||||||
|
|
||||||
|
using ::LocalFree;
|
||||||
|
#else
|
||||||
|
extern "C" typedef HANDLE_ HLOCAL_;
|
||||||
|
extern "C" __declspec(dllimport) HLOCAL_ WINAPI
|
||||||
|
LocalFree(HLOCAL_ hMem);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_LOCALFREE_HPP
|
109
include/boost/detail/win/basic_types.hpp
Normal file
109
include/boost/detail/win/basic_types.hpp
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
// basic_types.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_BASIC_TYPES_HPP
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <cstdarg>
|
||||||
|
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
# include <windows.h>
|
||||||
|
#elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
|
||||||
|
# include <WinError.h>
|
||||||
|
// @FIXME Which condition must be tested
|
||||||
|
# ifdef UNDER_CE
|
||||||
|
# ifndef WINAPI
|
||||||
|
# ifndef _WIN32_WCE_EMULATION
|
||||||
|
# define WINAPI __cdecl // Note this doesn't match the desktop definition
|
||||||
|
# else
|
||||||
|
# define WINAPI __stdcall
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# ifndef WINAPI
|
||||||
|
# define WINAPI __stdcall
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# error "Win32 functions not available"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef ::BOOL BOOL_;
|
||||||
|
typedef ::WORD WORD_;
|
||||||
|
typedef ::DWORD DWORD_;
|
||||||
|
typedef ::HANDLE HANDLE_;
|
||||||
|
typedef ::LONG LONG_;
|
||||||
|
typedef ::LONGLONG LONGLONG_;
|
||||||
|
typedef ::ULONG_PTR ULONG_PTR_;
|
||||||
|
typedef ::LARGE_INTEGER LARGE_INTEGER_;
|
||||||
|
typedef ::PLARGE_INTEGER PLARGE_INTEGER_;
|
||||||
|
typedef ::PVOID PVOID_;
|
||||||
|
typedef ::LPVOID LPVOID_;
|
||||||
|
typedef ::CHAR CHAR_;
|
||||||
|
typedef ::LPSTR LPSTR_;
|
||||||
|
typedef ::LPCSTR LPCSTR_;
|
||||||
|
typedef ::WCHAR WCHAR_;
|
||||||
|
typedef ::LPWSTR LPWSTR_;
|
||||||
|
typedef ::LPCWSTR LPCWSTR_;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
typedef int BOOL_;
|
||||||
|
typedef unsigned short WORD_;
|
||||||
|
typedef unsigned long DWORD_;
|
||||||
|
typedef void* HANDLE_;
|
||||||
|
|
||||||
|
typedef long LONG_;
|
||||||
|
|
||||||
|
// @FIXME Which condition must be tested
|
||||||
|
#if !defined(_M_IX86)
|
||||||
|
#if defined(__CYGWIN__)
|
||||||
|
typedef double LONGLONG_;
|
||||||
|
#else
|
||||||
|
typedef __int64 LONGLONG_;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
typedef double LONGLONG_;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# ifdef _WIN64
|
||||||
|
#if defined(__CYGWIN__)
|
||||||
|
typedef unsigned long ULONG_PTR_;
|
||||||
|
#else
|
||||||
|
typedef unsigned __int64 ULONG_PTR_;
|
||||||
|
#endif
|
||||||
|
# else
|
||||||
|
typedef unsigned long ULONG_PTR_;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
typedef struct _LARGE_INTEGER {
|
||||||
|
LONGLONG_ QuadPart;
|
||||||
|
} LARGE_INTEGER_;
|
||||||
|
typedef LARGE_INTEGER_ *PLARGE_INTEGER_;
|
||||||
|
|
||||||
|
typedef void *PVOID_;
|
||||||
|
typedef void *LPVOID_;
|
||||||
|
typedef const void *LPCVOID_;
|
||||||
|
|
||||||
|
typedef char CHAR_;
|
||||||
|
typedef CHAR_ *LPSTR_;
|
||||||
|
typedef const CHAR_ *LPCSTR_;
|
||||||
|
|
||||||
|
typedef wchar_t WCHAR_;
|
||||||
|
typedef WCHAR_ *LPWSTR_;
|
||||||
|
typedef const WCHAR_ *LPCWSTR_;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
43
include/boost/detail/win/directory_management.hpp
Normal file
43
include/boost/detail/win/directory_management.hpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
// directory_management.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_DIRECTORY_MANAGEMENT_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/security.hpp>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::CreateDirectory;
|
||||||
|
using ::CreateDirectoryA;
|
||||||
|
using ::GetTempPathA;
|
||||||
|
using ::RemoveDirectoryA;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
CreateDirectory(LPCTSTR_, LPSECURITY_ATTRIBUTES_*);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
CreateDirectoryA(LPCTSTR_, interprocess_security_attributes*);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
GetTempPathA(unsigned long length, char *buffer);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
RemoveDirectoryA(LPCTSTR_);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
52
include/boost/detail/win/dll.hpp
Normal file
52
include/boost/detail/win/dll.hpp
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// dll.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_DLL_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_DLL_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/security.hpp>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::LoadLibrary;
|
||||||
|
using ::FreeLibrary;
|
||||||
|
using ::GetProcAddress;
|
||||||
|
using ::GetModuleHandleA;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) HMODULE_ __stdcall
|
||||||
|
LoadLibrary(
|
||||||
|
LPCTSTR_ lpFileName
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
FreeLibrary(
|
||||||
|
HMODULE_ hModule
|
||||||
|
);
|
||||||
|
__declspec(dllimport) FARPROC_ __stdcall
|
||||||
|
GetProcAddress(
|
||||||
|
HMODULE_ hModule,
|
||||||
|
LPCSTR_ lpProcName
|
||||||
|
);
|
||||||
|
__declspec(dllimport) FARPROC_ __stdcall
|
||||||
|
GetModuleHandleA(
|
||||||
|
LPCSTR_ lpProcName
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
88
include/boost/detail/win/error_handling.hpp
Normal file
88
include/boost/detail/win/error_handling.hpp
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
// error_handling.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/GetCurrentThread.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::FormatMessageA;
|
||||||
|
using ::FormatMessageW;
|
||||||
|
|
||||||
|
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= FORMAT_MESSAGE_ALLOCATE_BUFFER;
|
||||||
|
const int FORMAT_MESSAGE_IGNORE_INSERTS_= FORMAT_MESSAGE_IGNORE_INSERTS;
|
||||||
|
const int FORMAT_MESSAGE_FROM_STRING_= FORMAT_MESSAGE_FROM_STRING;
|
||||||
|
const int FORMAT_MESSAGE_FROM_HMODULE_= FORMAT_MESSAGE_FROM_HMODULE;
|
||||||
|
const int FORMAT_MESSAGE_FROM_SYSTEM_= FORMAT_MESSAGE_FROM_SYSTEM;
|
||||||
|
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= FORMAT_MESSAGE_ARGUMENT_ARRAY;
|
||||||
|
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= FORMAT_MESSAGE_MAX_WIDTH_MASK;
|
||||||
|
|
||||||
|
const char LANG_NEUTRAL_= LANG_NEUTRAL;
|
||||||
|
const char LANG_INVARIANT_= LANG_INVARIANT;
|
||||||
|
|
||||||
|
const char SUBLANG_DEFAULT_= SUBLANG_DEFAULT; // user default
|
||||||
|
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||||
|
return MAKELANGID(p,s);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
// using ::FormatMessageA;
|
||||||
|
__declspec(dllimport)
|
||||||
|
DWORD_
|
||||||
|
WINAPI
|
||||||
|
FormatMessageA(
|
||||||
|
DWORD_ dwFlags,
|
||||||
|
LPCVOID_ lpSource,
|
||||||
|
DWORD_ dwMessageId,
|
||||||
|
DWORD_ dwLanguageId,
|
||||||
|
LPSTR_ lpBuffer,
|
||||||
|
DWORD_ nSize,
|
||||||
|
va_list *Arguments
|
||||||
|
);
|
||||||
|
|
||||||
|
// using ::FormatMessageW;
|
||||||
|
__declspec(dllimport)
|
||||||
|
DWORD_
|
||||||
|
WINAPI
|
||||||
|
FormatMessageW(
|
||||||
|
DWORD_ dwFlags,
|
||||||
|
LPCVOID_ lpSource,
|
||||||
|
DWORD_ dwMessageId,
|
||||||
|
DWORD_ dwLanguageId,
|
||||||
|
LPWSTR_ lpBuffer,
|
||||||
|
DWORD_ nSize,
|
||||||
|
va_list *Arguments
|
||||||
|
);
|
||||||
|
|
||||||
|
const int FORMAT_MESSAGE_ALLOCATE_BUFFER_= 0x00000100;
|
||||||
|
const int FORMAT_MESSAGE_IGNORE_INSERTS_= 0x00000200;
|
||||||
|
const int FORMAT_MESSAGE_FROM_STRING_= 0x00000400;
|
||||||
|
const int FORMAT_MESSAGE_FROM_HMODULE_= 0x00000800;
|
||||||
|
const int FORMAT_MESSAGE_FROM_SYSTEM_= 0x00001000;
|
||||||
|
const int FORMAT_MESSAGE_ARGUMENT_ARRAY_= 0x00002000;
|
||||||
|
const int FORMAT_MESSAGE_MAX_WIDTH_MASK_= 0x000000FF;
|
||||||
|
|
||||||
|
const char LANG_NEUTRAL_= 0x00;
|
||||||
|
const char LANG_INVARIANT_= 0x7f;
|
||||||
|
|
||||||
|
const char SUBLANG_DEFAULT_= 0x01; // user default
|
||||||
|
inline WORD_ MAKELANGID_(WORD_ p, WORD_ s) {
|
||||||
|
return ((((WORD_ )(s)) << 10) | (WORD_ )(p));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_ERROR_HANDLING_HPP
|
126
include/boost/detail/win/file_management.hpp
Normal file
126
include/boost/detail/win/file_management.hpp
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
// thread.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_FILE_MANAGEMENT_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/security.hpp>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::CreateFileA;
|
||||||
|
using ::DeleteFileA;
|
||||||
|
using ::FindFirstFileA;
|
||||||
|
using ::FindNextFileA;
|
||||||
|
using ::FindClose;
|
||||||
|
using ::GetFileSizeEx;
|
||||||
|
using ::MoveFileExA;
|
||||||
|
using ::SetFileValidData;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
typedef struct _OVERLAPPED {
|
||||||
|
ULONG_PTR Internal;
|
||||||
|
ULONG_PTR InternalHigh;
|
||||||
|
union {
|
||||||
|
struct {
|
||||||
|
DWORD Offset;
|
||||||
|
DWORD OffsetHigh;
|
||||||
|
} ;
|
||||||
|
PVOID Pointer;
|
||||||
|
} ;
|
||||||
|
HANDLE hEvent;
|
||||||
|
} OVERLAPPED, *LPOVERLAPPED;
|
||||||
|
|
||||||
|
|
||||||
|
__declspec(dllimport) void * __stdcall
|
||||||
|
CreateFileA (const char *, unsigned long, unsigned long, struct SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, void *);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
DeleteFileA (const char *);
|
||||||
|
__declspec(dllimport) void *__stdcall
|
||||||
|
FindFirstFileA(const char *lpFileName, win32_find_data_t *lpFindFileData);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
FindNextFileA(void *hFindFile, win32_find_data_t *lpFindFileData);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
FindClose(void *hFindFile);
|
||||||
|
__declspec(dllimport) BOOL __stdcall
|
||||||
|
GetFileSizeEx(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
PLARGE_INTEGER_ lpFileSize
|
||||||
|
);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
MoveFileExA (const char *, const char *, unsigned long);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
SetFileValidData(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
LONGLONG_ ValidDataLength
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
SetEndOfFile(
|
||||||
|
HANDLE_ hFile
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
SetFilePointerEx(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
LARGE_INTEGER_ liDistanceToMove,
|
||||||
|
PLARGE_INTEGER_ lpNewFilePointer,
|
||||||
|
DWORD_ dwMoveMethod
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
LockFile(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
DWORD_ dwFileOffsetLow,
|
||||||
|
DWORD_ dwFileOffsetHigh,
|
||||||
|
DWORD_ nNumberOfBytesToLockLow,
|
||||||
|
DWORD_ nNumberOfBytesToLockHigh
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
UnlockFile(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
DWORD_ dwFileOffsetLow,
|
||||||
|
DWORD_ dwFileOffsetHigh,
|
||||||
|
DWORD_ nNumberOfBytesToUnlockLow,
|
||||||
|
DWORD_ nNumberOfBytesToUnlockHigh
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
LockFileEx(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
DWORD_ dwFlags,
|
||||||
|
DWORD_ dwReserved,
|
||||||
|
DWORD_ nNumberOfBytesToLockLow,
|
||||||
|
DWORD_ nNumberOfBytesToLockHigh,
|
||||||
|
LPOVERLAPPED_ lpOverlapped
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
UnlockFileEx(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
DWORD_ dwReserved,
|
||||||
|
DWORD_ nNumberOfBytesToUnlockLow,
|
||||||
|
DWORD_ nNumberOfBytesToUnlockHigh,
|
||||||
|
LPOVERLAPPED_ lpOverlapped
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
WriteFile(
|
||||||
|
HANDLE_ hFile,
|
||||||
|
LPCVOID_ lpBuffer,
|
||||||
|
DWORD_ nNumberOfBytesToWrite,
|
||||||
|
LPDWORD_ lpNumberOfBytesWritten,
|
||||||
|
LPOVERLAPPED_ lpOverlapped
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
37
include/boost/detail/win/handles.hpp
Normal file
37
include/boost/detail/win/handles.hpp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// memory.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_HANDLES_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_HANDLES_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::CloseHandle;
|
||||||
|
using ::DuplicateHandle;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
CloseHandle(void*);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
DuplicateHandle(void*,void*,void*,void**,unsigned long,int,unsigned long);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_HANDLES_HPP
|
59
include/boost/detail/win/memory.hpp
Normal file
59
include/boost/detail/win/memory.hpp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// memory.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_MEMORY_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_MEMORY_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/security.hpp>
|
||||||
|
#include <boost/detail/win/LocalFree.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::CreateFileMappingA;
|
||||||
|
using ::FlushViewOfFile;
|
||||||
|
using ::GetProcessHeap;
|
||||||
|
using ::HeapAlloc;
|
||||||
|
using ::HeapFree;
|
||||||
|
using ::MapViewOfFileEx;
|
||||||
|
using ::OpenFileMappingA;
|
||||||
|
using ::UnmapViewOfFile;
|
||||||
|
#else
|
||||||
|
# ifdef HeapAlloc
|
||||||
|
# undef HeapAlloc
|
||||||
|
# endif
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) void * __stdcall
|
||||||
|
CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
FlushViewOfFile (void *, std::size_t);
|
||||||
|
__declspec(dllimport) HANDLE_ __stdcall
|
||||||
|
GetProcessHeap();
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
HeapAlloc(HANDLE_,DWORD_,SIZE_T_);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
HeapFree(HANDLE_,DWORD_,LPVOID_);
|
||||||
|
__declspec(dllimport) void * __stdcall
|
||||||
|
MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*);
|
||||||
|
__declspec(dllimport) void * __stdcall
|
||||||
|
OpenFileMappingA (unsigned long, int, const char *);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
UnmapViewOfFile(void *);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
33
include/boost/detail/win/process.hpp
Normal file
33
include/boost/detail/win/process.hpp
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
// process.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_PROCESS_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_PROCESS_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/GetCurrentProcess.hpp>
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetCurrentProcessId;
|
||||||
|
#else
|
||||||
|
# ifndef UNDER_CE
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
GetCurrentProcessId(void);
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
using ::GetCurrentProcessId;
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_PROCESS_HPP
|
62
include/boost/detail/win/security.hpp
Normal file
62
include/boost/detail/win/security.hpp
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// security.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_SECURITY_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_SECURITY_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef ::SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES_;
|
||||||
|
typedef ::PSECURITY_ATTRIBUTES PSECURITY_ATTRIBUTES_;
|
||||||
|
typedef ::LPSECURITY_ATTRIBUTES LPSECURITY_ATTRIBUTES_;
|
||||||
|
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
struct SECURITY_DESCRIPTOR_;
|
||||||
|
typedef SECURITY_DESCRIPTOR_* PSECURITY_DESCRIPTOR_;
|
||||||
|
typedef struct _ACL {
|
||||||
|
BYTE_ AclRevision;
|
||||||
|
BYTE_ Sbz1;
|
||||||
|
WORD_ AclSize;
|
||||||
|
WORD_ AceCount;
|
||||||
|
WORD_ Sbz2;
|
||||||
|
} ACL_, *PACL_;
|
||||||
|
|
||||||
|
typedef struct _SECURITY_ATTRIBUTES {
|
||||||
|
DWORD_ nLength;
|
||||||
|
LPVOID_ lpSecurityDescriptor;
|
||||||
|
BOOL_ bInheritHandle;
|
||||||
|
} SECURITY_ATTRIBUTES_, *PSECURITY_ATTRIBUTES_, *LPSECURITY_ATTRIBUTES_;
|
||||||
|
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
InitializeSecurityDescriptor(
|
||||||
|
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||||
|
DWORD_ dwRevision
|
||||||
|
);
|
||||||
|
__declspec(dllimport) BOOL_ __stdcall
|
||||||
|
SetSecurityDescriptorDacl(
|
||||||
|
PSECURITY_DESCRIPTOR_ pSecurityDescriptor,
|
||||||
|
BOOL_ bDaclPresent,
|
||||||
|
PACL_ pDacl,
|
||||||
|
BOOL_ bDaclDefaulted
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_SECURITY_HPP
|
125
include/boost/detail/win/synchronization.hpp
Normal file
125
include/boost/detail/win/synchronization.hpp
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
// synchronizaion.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
|
||||||
|
typedef ::PAPCFUNC PAPCFUNC_;
|
||||||
|
|
||||||
|
using ::InitializeCriticalSection;
|
||||||
|
using ::EnterCriticalSection;
|
||||||
|
using ::TryEnterCriticalSection;
|
||||||
|
using ::LeaveCriticalSection;
|
||||||
|
using ::DeleteCriticalSection;
|
||||||
|
|
||||||
|
# ifdef BOOST_NO_ANSI_APIS
|
||||||
|
using ::CreateMutexW;
|
||||||
|
using ::CreateEventW;
|
||||||
|
using ::OpenEventW;
|
||||||
|
using ::CreateSemaphoreW;
|
||||||
|
# else
|
||||||
|
using ::CreateMutexA;
|
||||||
|
using ::CreateEventA;
|
||||||
|
using ::OpenEventA;
|
||||||
|
using ::CreateSemaphoreA;
|
||||||
|
# endif
|
||||||
|
using ::ReleaseMutex;
|
||||||
|
using ::ReleaseSemaphore;
|
||||||
|
using ::SetEvent;
|
||||||
|
using ::ResetEvent;
|
||||||
|
using ::WaitForMultipleObjects;
|
||||||
|
using ::WaitForSingleObject;
|
||||||
|
using ::QueueUserAPC;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
struct CRITICAL_SECTION_
|
||||||
|
{
|
||||||
|
struct critical_section_debug * DebugInfo;
|
||||||
|
long LockCount;
|
||||||
|
long RecursionCount;
|
||||||
|
void * OwningThread;
|
||||||
|
void * LockSemaphore;
|
||||||
|
#if defined(_WIN64)
|
||||||
|
unsigned __int64 SpinCount;
|
||||||
|
#else
|
||||||
|
unsigned long SpinCount;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
InitializeCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
EnterCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
__declspec(dllimport) bool __stdcall
|
||||||
|
TryEnterCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
LeaveCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
DeleteCriticalSection(CRITICAL_SECTION_ *);
|
||||||
|
|
||||||
|
struct _SECURITY_ATTRIBUTES;
|
||||||
|
# ifdef BOOST_NO_ANSI_APIS
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
OpenEventW(unsigned long,int,wchar_t const*);
|
||||||
|
# else
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
|
||||||
|
__declspec(dllimport) void* __stdcall
|
||||||
|
OpenEventA(unsigned long,int,char const*);
|
||||||
|
# endif
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
ReleaseMutex(void*);
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
WaitForSingleObject(void*,unsigned long);
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
WaitForMultipleObjects(unsigned long nCount,
|
||||||
|
void* const * lpHandles,
|
||||||
|
int bWaitAll,
|
||||||
|
unsigned long dwMilliseconds);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
ReleaseSemaphore(void*,long,long*);
|
||||||
|
typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
|
||||||
|
# ifndef UNDER_CE
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
SetEvent(void*);
|
||||||
|
__declspec(dllimport) int __stdcall
|
||||||
|
ResetEvent(void*);
|
||||||
|
# else
|
||||||
|
using ::SetEvent;
|
||||||
|
using ::ResetEvent;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
|
50
include/boost/detail/win/system.hpp
Normal file
50
include/boost/detail/win/system.hpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// system.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_SYSTEM_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_SYSTEM_HPP
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
#include <cstdarg>
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
extern "C" __declspec(dllimport) void __stdcall GetSystemInfo (struct system_info *);
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef ::SYSTEM_INFO SYSTEM_INFO_;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
typedef struct _SYSTEM_INFO {
|
||||||
|
union {
|
||||||
|
DWORD_ dwOemId;
|
||||||
|
struct {
|
||||||
|
WORD_ wProcessorArchitecture;
|
||||||
|
WORD_ wReserved;
|
||||||
|
} dummy;
|
||||||
|
} ;
|
||||||
|
DWORD_ dwPageSize;
|
||||||
|
LPVOID_ lpMinimumApplicationAddress;
|
||||||
|
LPVOID_ lpMaximumApplicationAddress;
|
||||||
|
DWORD_PTR_ dwActiveProcessorMask;
|
||||||
|
DWORD_ dwNumberOfProcessors;
|
||||||
|
DWORD_ dwProcessorType;
|
||||||
|
DWORD_ dwAllocationGranularity;
|
||||||
|
WORD_ wProcessorLevel;
|
||||||
|
WORD_ wProcessorRevision;
|
||||||
|
} SYSTEM_INFO_;
|
||||||
|
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
GetSystemInfo (struct system_info *);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
45
include/boost/detail/win/thread.hpp
Normal file
45
include/boost/detail/win/thread.hpp
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// thread.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_THREAD_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_THREAD_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
#include <boost/detail/win/GetCurrentThread.hpp>
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::GetCurrentThreadId;
|
||||||
|
using ::SleepEx;
|
||||||
|
using ::Sleep;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
# ifndef UNDER_CE
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
GetCurrentThreadId(void);
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
SleepEx(unsigned long,int);
|
||||||
|
__declspec(dllimport) void __stdcall
|
||||||
|
Sleep(unsigned long);
|
||||||
|
#else
|
||||||
|
using ::GetCurrentThreadId;
|
||||||
|
using ::SleepEx;
|
||||||
|
using ::Sleep;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_THREAD_HPP
|
68
include/boost/detail/win/time.hpp
Normal file
68
include/boost/detail/win/time.hpp
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
// time.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_TIME_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_TIME_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost {
|
||||||
|
namespace detail {
|
||||||
|
namespace win32 {
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
typedef FILETIME FILETIME_;
|
||||||
|
typedef PFILETIME PFILETIME_;
|
||||||
|
typedef LPFILETIME LPFILETIME_;
|
||||||
|
|
||||||
|
typedef SYSTEMTIME SYSTEMTIME_;
|
||||||
|
typedef SYSTEMTIME* PSYSTEMTIME_;
|
||||||
|
|
||||||
|
using ::GetSystemTimeAsFileTime;
|
||||||
|
using ::FileTimeToLocalFileTime;
|
||||||
|
using ::GetSystemTime;
|
||||||
|
using ::SystemTimeToFileTime;
|
||||||
|
using ::GetTickCount;
|
||||||
|
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
typedef struct _FILETIME {
|
||||||
|
DWORD_ dwLowDateTime;
|
||||||
|
DWORD_ dwHighDateTime;
|
||||||
|
} FILETIME_, *PFILETIME_, *LPFILETIME_;
|
||||||
|
|
||||||
|
typedef struct _SYSTEMTIME {
|
||||||
|
WORD_ wYear;
|
||||||
|
WORD_ wMonth;
|
||||||
|
WORD_ wDayOfWeek;
|
||||||
|
WORD_ wDay;
|
||||||
|
WORD_ wHour;
|
||||||
|
WORD_ wMinute;
|
||||||
|
WORD_ wSecond;
|
||||||
|
WORD_ wMilliseconds;
|
||||||
|
} SYSTEMTIME_, *PSYSTEMTIME_;
|
||||||
|
|
||||||
|
__declspec(dllimport) void WINAPI
|
||||||
|
GetSystemTimeAsFileTime(FILETIME_* lpFileTime);
|
||||||
|
__declspec(dllimport) int WINAPI
|
||||||
|
FileTimeToLocalFileTime(const FILETIME_* lpFileTime,
|
||||||
|
FILETIME_* lpLocalFileTime);
|
||||||
|
__declspec(dllimport) void WINAPI
|
||||||
|
GetSystemTime(SYSTEMTIME_* lpSystemTime);
|
||||||
|
__declspec(dllimport) int WINAPI
|
||||||
|
SystemTimeToFileTime(const SYSTEMTIME_* lpSystemTime,
|
||||||
|
FILETIME_* lpFileTime);
|
||||||
|
__declspec(dllimport) unsigned long __stdcall
|
||||||
|
GetTickCount();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIME_HPP
|
41
include/boost/detail/win/timers.hpp
Normal file
41
include/boost/detail/win/timers.hpp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
// timers.hpp --------------------------------------------------------------//
|
||||||
|
|
||||||
|
// Copyright 2010 Vicente J. Botet Escriba
|
||||||
|
|
||||||
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
|
// See http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef BOOST_DETAIL_WIN_TIMERS_HPP
|
||||||
|
#define BOOST_DETAIL_WIN_TIMERS_HPP
|
||||||
|
|
||||||
|
#include <boost/detail/win/basic_types.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace win32
|
||||||
|
{
|
||||||
|
#if defined( BOOST_USE_WINDOWS_H )
|
||||||
|
using ::QueryPerformanceCounter;
|
||||||
|
using ::QueryPerformanceFrequency;
|
||||||
|
#else
|
||||||
|
extern "C" {
|
||||||
|
__declspec(dllimport) BOOL_ WINAPI
|
||||||
|
QueryPerformanceCounter(
|
||||||
|
LARGE_INTEGER_ *lpPerformanceCount
|
||||||
|
);
|
||||||
|
|
||||||
|
__declspec(dllimport) BOOL_ WINAPI
|
||||||
|
QueryPerformanceFrequency(
|
||||||
|
LARGE_INTEGER_ *lpFrequency
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // BOOST_DETAIL_WIN_TIMERS_HPP
|
Reference in New Issue
Block a user