Skip to content

Commit 6b8f706

Browse files
committed
first pass adding headers and exceptions
1 parent bd329b1 commit 6b8f706

16 files changed

Lines changed: 10578 additions & 3407 deletions

mujocoRelease.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.0
1+
3.1.1

src/main/java/libmujoco.so

3.94 MB
Binary file not shown.

src/main/java/mujoco/mjdata.h

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

src/main/java/mujoco/mjexport.h

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright 2021 DeepMind Technologies Limited
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef MUJOCO_MJEXPORT_H_
16+
#define MUJOCO_MJEXPORT_H_
17+
18+
#if defined _WIN32 || defined __CYGWIN__
19+
#define MUJOCO_HELPER_DLL_IMPORT __declspec(dllimport)
20+
#define MUJOCO_HELPER_DLL_EXPORT __declspec(dllexport)
21+
#define MUJOCO_HELPER_DLL_LOCAL
22+
#else
23+
#if __GNUC__ >= 4
24+
#define MUJOCO_HELPER_DLL_IMPORT __attribute__ ((visibility ("default")))
25+
#define MUJOCO_HELPER_DLL_EXPORT __attribute__ ((visibility ("default")))
26+
#define MUJOCO_HELPER_DLL_LOCAL __attribute__ ((visibility ("hidden")))
27+
#else
28+
#define MUJOCO_HELPER_DLL_IMPORT
29+
#define MUJOCO_HELPER_DLL_EXPORT
30+
#define MUJOCO_HELPER_DLL_LOCAL
31+
#endif
32+
#endif
33+
34+
#ifdef MJ_STATIC
35+
// static library
36+
#define MJAPI
37+
#define MJLOCAL
38+
#else
39+
#ifdef MUJOCO_DLL_EXPORTS
40+
#define MJAPI MUJOCO_HELPER_DLL_EXPORT
41+
#else
42+
#define MJAPI MUJOCO_HELPER_DLL_IMPORT
43+
#endif
44+
#define MJLOCAL MUJOCO_HELPER_DLL_LOCAL
45+
#endif
46+
47+
#endif // MUJOCO_MJEXPORT_H_

src/main/java/mujoco/mjmacro.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Copyright 2023 DeepMind Technologies Limited
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef MUJOCO_MJMACRO_H_
16+
#define MUJOCO_MJMACRO_H_
17+
18+
// include asan interface header, or provide stubs for poison/unpoison macros when not using asan
19+
#ifdef ADDRESS_SANITIZER
20+
#include <sanitizer/asan_interface.h>
21+
#elif defined(_MSC_VER)
22+
#define ASAN_POISON_MEMORY_REGION(addr, size)
23+
#define ASAN_UNPOISON_MEMORY_REGION(addr, size)
24+
#else
25+
#define ASAN_POISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
26+
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) ((void)(addr), (void)(size))
27+
#endif
28+
29+
// max and min (use only for primitive types)
30+
#define mjMAX(a, b) (((a) > (b)) ? (a) : (b))
31+
#define mjMIN(a, b) (((a) < (b)) ? (a) : (b))
32+
33+
// return current value of mjOption enable/disable flags
34+
#define mjDISABLED(x) (m->opt.disableflags & (x))
35+
#define mjENABLED(x) (m->opt.enableflags & (x))
36+
37+
// is actuator disabled
38+
#define mjACTUATORDISABLED(i) (m->opt.disableactuator & (1 << m->actuator_group[i]))
39+
40+
// annotation for functions that accept printf-like variadic arguments
41+
#ifndef mjPRINTFLIKE
42+
#if defined(__GNUC__)
43+
#define mjPRINTFLIKE(n, m) __attribute__((format(printf, n, m)))
44+
#else
45+
#define mjPRINTFLIKE(n, m)
46+
#endif
47+
#endif
48+
49+
#endif // MUJOCO_MJMACRO_H_

0 commit comments

Comments
 (0)