LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
Portability.hh
Go to the documentation of this file.
1
41#ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH
42#define CRL_MULTISENSE_DETAILS_PORTABILITY_HH
43
44#define CRL_UNUSED(var) (void)(var)
45
46#if defined(CRL_HAVE_CONSTEXPR)
47 #define CRL_CONSTEXPR constexpr
48#else
49 #define CRL_CONSTEXPR const
50#endif
51
52#if __cplusplus > 199711L
53 // Use C++ 11 standard language features.
54 #define CRL_THREAD_LOCAL thread_local
55#elif defined (__GNUC__)
56 // GNU GCC uses __thread to declare thread local variables.
57 #define CRL_THREAD_LOCAL __thread
58#elif defined (_MSC_VER)
59 // MS Visual C++ uses __declspec(thread) to declare thread local variables.
60 #define CRL_THREAD_LOCAL __declspec(thread)
61#else
62 #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
63#endif
64
65#if defined (__GNUC__)
66 // GNU GCC uses __PRETTY_FUNCTION__ to get the undecorated name of the current function
67 // with its type signature.
68 #define CRL_PRETTY_FUNCTION __PRETTY_FUNCTION__
69#elif defined (_MSC_VER)
70 // MS Visual C++ uses __FUNCSIG__ to get the undecorated name of the current function
71 #define CRL_PRETTY_FUNCTION __FUNCSIG__
72#elif __STDC_VERSION >= 199901L
73 // Use C99 standard macros to get the undecorated name of the current function
74 #define CRL_PRETTY_FUNCTION __func__
75#else
76 #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
77#endif
78
79#if !defined(MULTISENSE_API)
80#if defined (_MSC_VER)
81#define MULTISENSE_API __declspec(dllexport)
82#else
83#define MULTISENSE_API
84#endif
85#endif
86
87#ifdef WIN32
88#ifndef NOMINMAX
89#define NOMINMAX 1
90#endif
91
92#define usleep(usec) Sleep((usec)/1000)
93#endif
94
95#ifndef WIN32
96#define closesocket close
97#endif
98
99#endif /* #ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH */