| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef MUJOCO_SRC_ENGINE_ENGINE_CROSSPLATFORM_H_ |
| | #define MUJOCO_SRC_ENGINE_ENGINE_CROSSPLATFORM_H_ |
| |
|
| | |
| | #if !defined(__cplusplus) |
| | #include <stddef.h> |
| | #include <stdlib.h> |
| | #else |
| | #include <cstddef> |
| | #include <cstdlib> |
| | #endif |
| | |
| |
|
| | |
| | #ifdef _WIN32 |
| | #define strcasecmp _stricmp |
| | #define strncasecmp _strnicmp |
| | #else |
| | #include <strings.h> |
| | #endif |
| |
|
| | |
| | #if defined(__cplusplus) |
| | #define mjFALLTHROUGH [[fallthrough]] |
| | #elif defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 7) |
| | #define mjFALLTHROUGH __attribute__((fallthrough)) |
| | #else |
| | #define mjFALLTHROUGH ((void) 0) |
| | #endif |
| |
|
| | |
| | #if defined(_MSC_VER) && !defined(__clang__) && !defined(__cplusplus) |
| | typedef long double mjtMaxAlign; |
| | #else |
| | typedef max_align_t mjtMaxAlign; |
| | #endif |
| |
|
| | |
| | #if defined(__GNUC__) |
| | #define mjLIKELY(x) __builtin_expect(!!(x), 1) |
| | #define mjUNLIKELY(x) __builtin_expect(!!(x), 0) |
| | #else |
| | #define mjLIKELY(x) (x) |
| | #define mjUNLIKELY(x) (x) |
| | #endif |
| |
|
| | #ifdef __cplusplus |
| | extern "C" { |
| | #endif |
| |
|
| | #ifdef ADDRESS_SANITIZER |
| | int mj__comparePcFuncName(void* pc1, void* pc2); |
| | const char* mj__getPcDebugInfo(void* pc); |
| | #endif |
| |
|
| | #ifdef __cplusplus |
| | } |
| | #endif |
| |
|
| | #endif |
| |
|