libwallaby  v24
The wallaby standard library
compat.hpp
Go to the documentation of this file.
1 /*
2  * compat.hpp
3  *
4  * Created on: Nov 6, 2015
5  * Author: Joshua Southerland
6  */
7 
8 #ifndef INCLUDE_WALLABY_COMPAT_HPP_
9 #define INCLUDE_WALLABY_COMPAT_HPP_
10 
11 
12 #ifdef _MSC_VER
13 #define NOMINMAX
14 #define WIN32_LEAN_AND_MEAN
15 #include <windows.h>
16 #endif
17 
18 namespace compat
19 {
20  int yield();
21  int microsleep(unsigned long microseconds);
22 }
23 
24 #ifdef _MSC_VER
25 
26 #define PRETTYFUNC __FUNCSIG__
27 #pragma section(".CRT$XCU", read)
28 #define INITIALIZER(f) \
29  static void __cdecl f(void); \
30  __declspec(allocate(".CRT$XCU")) void (__cdecl*f##_)(void) = f; \
31  static void __cdecl f(void)
32 typedef SSIZE_T ssize_t;
33 
34 #else
35 
36 #define PRETTYFUNC __PRETTY_FUNCTION__
37 #define INITIALIZER(f) \
38  static void f(void) __attribute__((constructor)); \
39  static void f(void)
40 
41 #endif
42 
43 
44 
45 #endif /* INCLUDE_WALLABY_COMPAT_HPP_ */
int yield()
Definition: compat.hpp:18
int microsleep(unsigned long microseconds)