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 __cplusplus > 199711L
47  // This compiler supports C++11.
48  #define CRL_CONSTEXPR constexpr
49 #else
50  // This compiler does not support C++11.
51  #define CRL_CONSTEXPR const
52 #endif
53 
54 #if __cplusplus > 199711L
55  // Use C++ 11 standard language features.
56  #define CRL_THREAD_LOCAL thread_local
57 #elif defined (__GNUC__)
58  // GNU GCC uses __thread to declare thread local variables.
59  #define CRL_THREAD_LOCAL __thread
60 #elif defined (_MSC_VER)
61  // MS Visual C++ uses __declspec(thread) to declare thread local variables.
62  #define CRL_THREAD_LOCAL __declspec(thread)
63 #else
64  #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
65 #endif
66 
67 #if defined (__GNUC__)
68  // GNU GCC uses __PRETTY_FUNCTION__ to get the undecorated name of the current function
69  // with its type signature.
70  #define CRL_PRETTY_FUNCTION __PRETTY_FUNCTION__
71 #elif defined (_MSC_VER)
72  // MS Visual C++ uses __FUNCSIG__ to get the undecorated name of the current function
73  #define CRL_PRETTY_FUNCTION __FUNCSIG__
74 #elif __STDC_VERSION >= 199901L
75  // Use C99 standard macros to get the undecorated name of the current function
76  #define CRL_PRETTY_FUNCTION __func__
77 #else
78  #error "This compiler is not yet supported. Please contact Carnegie Robotics support at http://support.carnegierobotics.com for assistance."
79 #endif
80 
81 #if !defined(MULTISENSE_API)
82 #if defined (_MSC_VER)
83 #if defined (MultiSense_EXPORTS)
84 #define MULTISENSE_API __declspec(dllexport)
85 #else
86 #define MULTISENSE_API __declspec(dllimport)
87 #endif
88 #else
89 #define MULTISENSE_API
90 #endif
91 #endif
92 
93 #ifdef WIN32
94 #ifndef NOMINMAX
95 #define NOMINMAX 1
96 #endif
97 
98 #define usleep(usec) Sleep((usec)/1000)
99 #endif
100 
101 #ifndef WIN32
102 #define closesocket close
103 #endif
104 
105 #endif /* #ifndef CRL_MULTISENSE_DETAILS_PORTABILITY_HH */


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50