Add .cmake files and fix LICENSE file path in make_sdist.sh.
Also make minor modifications to Python bindings code for GCC compatibility. Fixes #191. PiperOrigin-RevId: 435127640 Change-Id: I8bd3a35bbb2724a24341072ba8df3da4372f83d3
This commit is contained in:
@@ -119,7 +119,12 @@ struct MjErrorIntercepter {
|
||||
template <typename Return, typename... Args, typename Callable>
|
||||
MUJOCO_ALWAYS_INLINE
|
||||
static constexpr auto WrapFunc(Callable&& callable) {
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
// GCC can't inline functions that call setjmp
|
||||
return [callable](Args... args) mutable {
|
||||
#else
|
||||
return [callable](Args... args) MUJOCO_ALWAYS_INLINE_LAMBDA_MUTABLE {
|
||||
#endif
|
||||
_mjPRIVATE__set_tls_error_fn(&MjErrorHandler);
|
||||
|
||||
// DON'T MIX RAII WITH SETJMP!
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
(defined(__GNUC__) && !defined(__clang__))
|
||||
#define MUJOCO_ALWAYS_INLINE __attribute__((always_inline))
|
||||
#define MUJOCO_ALWAYS_INLINE_LAMBDA MUJOCO_ALWAYS_INLINE
|
||||
#if defined(__clang__)
|
||||
#define MUJOCO_ALWAYS_INLINE_LAMBDA_MUTABLE MUJOCO_ALWAYS_INLINE_LAMBDA mutable
|
||||
#else
|
||||
#define MUJOCO_ALWAYS_INLINE_LAMBDA_MUTABLE mutable MUJOCO_ALWAYS_INLINE_LAMBDA
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#define MUJOCO_ALWAYS_INLINE __forceinline
|
||||
#if _MSC_VER >= 1927 && _MSVC_LANG >= 202002L
|
||||
|
||||
Reference in New Issue
Block a user