| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | #ifndef MUJOCO_SRC_ENGINE_ENGINE_MACRO_H_ |
| | #define MUJOCO_SRC_ENGINE_ENGINE_MACRO_H_ |
| |
|
| | #include <stdint.h> |
| |
|
| | #include <mujoco/mjmacro.h> |
| | #include "engine/engine_callback.h" |
| |
|
| | |
| |
|
| | |
| | #ifdef _MSC_VER |
| | #define mjTHREADLOCAL __declspec(thread) |
| | #else |
| | #define mjTHREADLOCAL _Thread_local |
| | #endif |
| |
|
| |
|
| | |
| |
|
| | #define TM_START mjtNum _tm = (mjcb_time ? mjcb_time() : 0); |
| | #define TM_RESTART _tm = (mjcb_time ? mjcb_time() : 0); |
| | #define TM_END(i) {d->timer[i].duration += ((mjcb_time ? mjcb_time() : 0) - _tm); d->timer[i].number++;} |
| | #define TM_ADD(i) {d->timer[i].duration += ((mjcb_time ? mjcb_time() : 0) - _tm);} |
| | #define TM_START1 mjtNum _tm1 = (mjcb_time ? mjcb_time() : 0); |
| | #define TM_END1(i) {d->timer[i].duration += ((mjcb_time ? mjcb_time() : 0) - _tm1); d->timer[i].number++;} |
| |
|
| | |
| |
|
| | #ifndef __has_builtin |
| | #define __has_builtin(x) 0 |
| | #endif |
| |
|
| | |
| |
|
| | #define PTRDIFF(x, y) ((char*)(x) - (char*)(y)) |
| |
|
| | #endif |
| |
|