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 #if defined (MultiSense_EXPORTS)
82 #define MULTISENSE_API __declspec(dllexport)
83 #else
84 #define MULTISENSE_API __declspec(dllimport)
85 #endif
86 #else
87 #define MULTISENSE_API
88 #endif
89 #endif
90 
91 #ifdef WIN32
92 #ifndef NOMINMAX
93 #define NOMINMAX 1
94 #endif
95 
96 #define usleep(usec) Sleep((usec)/1000)
97 #endif
98 
99 #ifndef WIN32
100 #define closesocket close
101 #endif
102 
103 #endif /* #ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH */


multisense_lib
Author(s):
autogenerated on Sat Jun 24 2023 03:01:21