]> rtime.felk.cvut.cz Git - eurobot/public.git/blob - src/boost/boost/detail/win/synchronization.hpp
Add subset of boost library headers needed for compilation on PowerPC
[eurobot/public.git] / src / boost / boost / detail / win / synchronization.hpp
1 //  synchronizaion.hpp  --------------------------------------------------------------//
2
3 //  Copyright 2010 Vicente J. Botet Escriba
4
5 //  Distributed under the Boost Software License, Version 1.0.
6 //  See http://www.boost.org/LICENSE_1_0.txt
7
8
9 #ifndef BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
10 #define BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP
11
12 #include <boost/detail/win/basic_types.hpp>
13
14
15 namespace boost
16 {
17 namespace detail
18 {
19 namespace win32
20 {
21 #if defined( BOOST_USE_WINDOWS_H )
22     typedef ::CRITICAL_SECTION CRITICAL_SECTION_;
23     typedef ::PAPCFUNC PAPCFUNC_;
24
25     using ::InitializeCriticalSection;
26     using ::EnterCriticalSection;
27     using ::TryEnterCriticalSection;
28     using ::LeaveCriticalSection;
29     using ::DeleteCriticalSection;
30     
31 # ifdef BOOST_NO_ANSI_APIS
32     using ::CreateMutexW;
33     using ::CreateEventW;
34     using ::OpenEventW;
35     using ::CreateSemaphoreW;
36 # else
37     using ::CreateMutexA;
38     using ::CreateEventA;
39     using ::OpenEventA;
40     using ::CreateSemaphoreA;
41 # endif
42     using ::ReleaseMutex;
43     using ::ReleaseSemaphore;
44     using ::SetEvent;
45     using ::ResetEvent;
46     using ::WaitForMultipleObjects;
47     using ::WaitForSingleObject;
48             using ::QueueUserAPC;
49 #else
50 extern "C" {
51     struct CRITICAL_SECTION_
52     {
53         struct critical_section_debug * DebugInfo;
54         long LockCount;
55         long RecursionCount;
56         void * OwningThread;
57         void * LockSemaphore;
58     #if defined(_WIN64)
59         unsigned __int64 SpinCount;
60     #else
61         unsigned long SpinCount;
62     #endif
63     };
64
65      __declspec(dllimport) void __stdcall 
66         InitializeCriticalSection(CRITICAL_SECTION_ *);
67     __declspec(dllimport) void __stdcall 
68         EnterCriticalSection(CRITICAL_SECTION_ *);
69     __declspec(dllimport) bool __stdcall 
70         TryEnterCriticalSection(CRITICAL_SECTION_ *);
71     __declspec(dllimport) void __stdcall 
72         LeaveCriticalSection(CRITICAL_SECTION_ *);
73     __declspec(dllimport) void __stdcall 
74         DeleteCriticalSection(CRITICAL_SECTION_ *);
75     
76     struct _SECURITY_ATTRIBUTES;
77 # ifdef BOOST_NO_ANSI_APIS
78     __declspec(dllimport) void* __stdcall 
79         CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*);
80     __declspec(dllimport) void* __stdcall 
81         CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*);
82     __declspec(dllimport) void* __stdcall 
83         CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*);
84     __declspec(dllimport) void* __stdcall 
85         OpenEventW(unsigned long,int,wchar_t const*);
86 # else
87     __declspec(dllimport) void* __stdcall 
88         CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*);
89     __declspec(dllimport) void* __stdcall 
90         CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*);
91     __declspec(dllimport) void* __stdcall 
92         CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*);
93     __declspec(dllimport) void* __stdcall 
94         OpenEventA(unsigned long,int,char const*);
95 # endif
96     __declspec(dllimport) int __stdcall 
97         ReleaseMutex(void*);
98     __declspec(dllimport) unsigned long __stdcall 
99         WaitForSingleObject(void*,unsigned long);
100     __declspec(dllimport) unsigned long __stdcall 
101         WaitForMultipleObjects(unsigned long nCount,
102                 void* const * lpHandles,
103                 int bWaitAll,
104                 unsigned long dwMilliseconds);
105     __declspec(dllimport) int __stdcall 
106         ReleaseSemaphore(void*,long,long*);
107     typedef void (__stdcall *PAPCFUNC8)(ulong_ptr);
108     __declspec(dllimport) unsigned long __stdcall 
109         QueueUserAPC(PAPCFUNC8,void*,ulong_ptr);
110 # ifndef UNDER_CE
111     __declspec(dllimport) int __stdcall 
112         SetEvent(void*);
113     __declspec(dllimport) int __stdcall 
114         ResetEvent(void*);
115 # else
116     using ::SetEvent;
117     using ::ResetEvent;
118 # endif
119 }    
120 #endif
121 }
122 }
123 }
124
125 #endif // BOOST_DETAIL_WIN_SYNCHRONIZATION_HPP