Tizen 2.1 base
[platform/upstream/gcd.git] / pthread_workqueue-0.8.2 / src / windows / platform.h
1 #ifndef _PTWQ_WINDOWS_PLATFORM_H
2 #define _PTWQ_WINDOWS_PLATFORM_H 1
3
4 #define PROVIDE_LEGACY_XP_SUPPORT 1
5
6 #ifdef PROVIDE_LEGACY_XP_SUPPORT
7 # define _WIN32_WINNT 0x0500
8 #else
9 # define _WIN32_WINNT 0x0610
10 #endif
11 #define WIN32_LEAN_AND_MEAN
12
13 #include <windows.h>
14 #include <string.h>
15 #include "winpthreads.h"
16
17 /* Instead of __attribute__ ((constructor)), use DllMain() */
18 #define CONSTRUCTOR       /* */
19
20 #define VISIBLE __declspec(dllexport)
21
22 # define __func__ __FUNCTION__
23
24 #undef LIST_HEAD
25 #include "queue.h"
26
27 #define sleep(sec)      Sleep(1000*sec)
28 #define strdup(p)       _strdup(p)
29 #define random()        rand()
30
31 #ifdef PROVIDE_LEGACY_XP_SUPPORT
32 # define WORKQUEUE_PLATFORM_SPECIFIC \
33         LIST_ENTRY(_pthread_workqueue) wqlist_entry
34 #else
35 /* Specific workqueue items */
36 # define WORKQUEUE_PLATFORM_SPECIFIC \
37         PTP_POOL win_thread_pool; \
38         TP_CALLBACK_ENVIRON win_callback_env
39 #endif
40
41
42 #endif  /* _PTWQ_WINDOWS_PLATFORM_H */