]> git.lyx.org Git - lyx.git/blob - boost/boost/detail/winapi.hpp
major boost update
[lyx.git] / boost / boost / detail / winapi.hpp
1 #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED
2 #define BOOST_DETAIL_WINAPI_HPP_INCLUDED
3
4 #if _MSC_VER >= 1020
5 #pragma once
6 #endif
7
8 //
9 //  boost/detail/winapi.hpp - a lightweight version of <windows.h>
10 //
11 //  Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
12 //
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.
17 //
18
19 namespace boost
20 {
21
22 namespace detail
23 {
24
25 namespace winapi
26 {
27
28 typedef long long_type;
29 typedef unsigned long dword_type;
30 typedef void * handle_type;
31
32 #if defined(_WIN64)
33
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;
38
39 #else
40
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;
45
46 #endif
47
48 struct critical_section
49 {
50     struct critical_section_debug * DebugInfo;
51     long_type LockCount;
52     long_type RecursionCount;
53     handle_type OwningThread;
54     handle_type LockSemaphore;
55     ulong_ptr_type SpinCount;
56 };
57
58 extern "C" __declspec(dllimport) long_type __stdcall InterlockedIncrement(long_type volatile *);
59 extern "C" __declspec(dllimport) long_type __stdcall InterlockedDecrement(long_type volatile *);
60 extern "C" __declspec(dllimport) long_type __stdcall InterlockedExchange(long_type volatile *, long_type);
61
62 extern "C" __declspec(dllimport) void __stdcall Sleep(dword_type);
63
64 extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *);
65 extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *);
66 extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *);
67 extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *);
68
69 } // namespace winapi
70
71 } // namespace detail
72
73 } // namespace boost
74
75 #endif // #ifndef BOOST_DETAIL_WINAPI_HPP_INCLUDED