Legacy/include/MultiSense/details/utility/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 https://carnegierobotics.com/submitaticket 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 https://carnegierobotics.com/submitaticket 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 #define SOCKET_ERRNO WSAGetLastError()
96 #define SOCKET_STR_ERR strerror(SOCKET_ERRNO)
97 #define CRL_EAGAIN WSAETIMEDOUT
98 #define usleep(usec) Sleep((usec)/1000)
99 #else
100 #define SOCKET_ERRNO errno
101 #define SOCKET_STR_ERR strerror(SOCKET_ERRNO)
102 #define CRL_EAGAIN EAGAIN
103 #define closesocket close
104 #endif
105 
106 #endif /* #ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH */


multisense_lib
Author(s):
autogenerated on Thu Apr 17 2025 02:49:09