9 #ifndef __ewf_platform_win32__h__included__
10 #define __ewf_platform_win32__h__included__
14 #ifndef EWF_PLATFORM_WIN32
15 #error EWF_PLATFORM_WIN32 must be defined before including this file
40 #define EWF_PLATFORM_TICKS_PER_SECOND (1000)
43 #define EWF_THREAD_PRIORITY_HIGH (THREAD_PRIORITY_ABOVE_NORMAL)
44 #define EWF_THREAD_PRIORITY_MEDIUM (THREAD_PRIORITY_NORMAL)
45 #define EWF_THREAD_PRIORITY_LOW (THREAD_PRIORITY_IDLE)
55 ewf_platform_thread_function thread_function_ptr;
56 void* thread_function_data;
59 #define EWF_PLATFORM_THREAD_STATIC_DECLARE(thread_ptr, thread_name_symb, thread_function_ptr_param, thread_function_data_param, stack_size_param, thread_priority_param) \
61 static ULONG _ewf_platform_thread__stack__##thread_name_symb[stack_size_param / sizeof(ULONG)]; \
62 static struct _ewf_platform_thread _ewf_platform_thread__##thread_name_symb = {0}; \
63 _ewf_platform_thread__##thread_name_symb.thread_function_ptr = thread_function_ptr_param; \
64 _ewf_platform_thread__##thread_name_symb.thread_function_data = thread_function_data_param; \
65 thread_ptr = &(_ewf_platform_thread__##thread_name_symb); \
73 #define EWF_PLATFORM_MUTEX_STATIC_DECLARE(mutex_ptr, mutex_name_symb) \
75 static struct _ewf_platform_mutex _ewf_platform_mutex__##mutex_name_symb = {0}; \
76 mutex_ptr = &(_ewf_platform_mutex__##mutex_name_symb); \
84 volatile uint32_t queue_size;
85 volatile uint32_t tail_index;
86 volatile uint32_t used_count;
96 #define EWF_PLATFORM_QUEUE_STATIC_DECLARE(queue_ptr, queue_name_symb, item_type, item_count) \
98 static item_type ewf_platform_queue__data__##queue_name_symb[item_count]; \
99 static ewf_platform_queue ewf_platform_queue__##queue_name_symb = {0}; \
100 ewf_platform_queue__##queue_name_symb.data = ewf_platform_queue__data__##queue_name_symb; \
101 ewf_platform_queue__##queue_name_symb.item_size = sizeof(item_type); \
102 ewf_platform_queue__##queue_name_symb.queue_size = item_count; \
103 ewf_platform_queue__##queue_name_symb.tail_index = 0; \
104 ewf_platform_queue__##queue_name_symb.used_count = 0; \
105 queue_ptr = &(ewf_platform_queue__##queue_name_symb); \