1 #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED
2 #define BOOST_DETAIL_WINAPI_HPP_INCLUDED
9 // boost/detail/winapi.hpp - a lightweight version of <windows.h>
11 // Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
13 // Permission to copy, use, modify, sell and distribute this software
14 // is granted provided this copyright notice appears in all copies.
15 // This software is provided "as is" without express or implied
16 // warranty, and with no claim as to its suitability for any purpose.
28 typedef long long_type;
29 typedef unsigned long dword_type;
30 typedef void * handle_type;
34 typedef __int64 int_ptr_type;
35 typedef unsigned __int64 uint_ptr_type;
36 typedef __int64 long_ptr_type;
37 typedef unsigned __int64 ulong_ptr_type;
41 typedef int int_ptr_type;
42 typedef unsigned int uint_ptr_type;
43 typedef long long_ptr_type;
44 typedef unsigned long ulong_ptr_type;
48 struct critical_section
50 struct critical_section_debug * DebugInfo;
52 long_type RecursionCount;
53 handle_type OwningThread;
54 handle_type LockSemaphore;
55 ulong_ptr_type SpinCount;
60 // Intel 6.0 on Win64 version, posted by Tim Fenders to [boost-users]
62 extern "C" long_type __cdecl _InterlockedIncrement(long_type volatile *);
63 extern "C" long_type __cdecl _InterlockedDecrement(long_type volatile *);
64 extern "C" long_type __cdecl _InterlockedExchange(long_type volatile *, long_type);
66 #pragma intrinsic(_InterlockedIncrement)
67 #pragma intrinsic(_InterlockedDecrement)
68 #pragma intrinsic(_InterlockedExchange)
70 inline long_type InterlockedIncrement(long_type volatile * lp)
72 return _InterlockedIncrement(lp);
75 inline long_type InterlockedDecrement(long_type volatile* lp)
77 return _InterlockedDecrement(lp);
80 inline long_type InterlockedExchange(long_type volatile* lp, long_type l)
82 return _InterlockedExchange(lp, l);
87 extern "C" __declspec(dllimport) long_type __stdcall InterlockedIncrement(long_type volatile *);
88 extern "C" __declspec(dllimport) long_type __stdcall InterlockedDecrement(long_type volatile *);
89 extern "C" __declspec(dllimport) long_type __stdcall InterlockedExchange(long_type volatile *, long_type);
93 extern "C" __declspec(dllimport) void __stdcall Sleep(dword_type);
95 extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *);
96 extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *);
97 extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *);
98 extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *);
100 } // namespace winapi
102 } // namespace detail
106 #endif // #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED