ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VP_SDK / VP_Os / win32 / vp_os_signal_dep.h
1 /**
2  *  \brief    OS Api for video sdk. Public definitions.
3  *  \author   Aurelien Morelle <aurelien.morelle@parrot.fr>
4  *  \author   Sylvain Gaeremynck <sylvain.gaeremynck@parrot.fr>
5  *  \version  2.0
6  *  \date     2006/12/15
7  */
8
9 #ifndef _SIGNAL_INCLUDE_OS_DEP_
10 #define _SIGNAL_INCLUDE_OS_DEP_
11
12 /* 
13 IMPORTANT - select here whether to use condition variables from
14                         the Windows SDK (Vista and later) or from the 'Pthread for Win32' library (XP and earlier).
15 */
16 #define USE_WINDOWS_CONDITION_VARIABLES
17 //#define USE_PTHREAD_FOR_WIN32
18
19
20
21 #include <VP_Os/vp_os.h>
22
23
24
25
26 #if defined USE_WINDOWS_CONDITION_VARIABLES
27         /* CONDITION_VARIABLE only work on VISTA/SEVEN/Server 2008 */
28         typedef CRITICAL_SECTION vp_os_mutex_t;
29
30         typedef struct
31         {
32           CONDITION_VARIABLE  cond;
33           vp_os_mutex_t       *mutex;
34         }
35         vp_os_cond_t;
36         
37
38 #elif defined USE_PTHREAD_FOR_WIN32
39                 #include <pthread.h>
40         
41                 typedef pthread_mutex_t vp_os_mutex_t;
42
43                 typedef struct _vp_os_cond_t_
44                 {
45                   pthread_cond_t  cond;
46                   vp_os_mutex_t     *mutex;
47                 }
48                 vp_os_cond_t;
49
50 #else
51
52         typedef CRITICAL_SECTION vp_os_cond_t;
53         typedef CRITICAL_SECTION vp_os_mutex_t;
54
55 #endif
56
57
58 #endif // ! _SIGNAL_INCLUDE_OS_DEP_
59