Files
Mujoco_WASM/plugin/sdf/register.cc
T
Sam Haves f2461f9ce6 Modify mj_PLUGIN_LIB_INIT to support multiple plugins in the same compilation unit.
Previously on MSVC we used DllMain to register plugins, you cannot have multiple definitions of DllMain in a single unit so you would get errors if you tried to register two plugins. This modifies the implementation to insert a function pointer into the C runtime initialization instead.

PiperOrigin-RevId: 896612678
Change-Id: I07732147b955d741c836acff6da986db0e9b9eff
2026-04-08 11:35:16 -07:00

33 lines
954 B
C++

// Copyright 2022 DeepMind Technologies Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <mujoco/mjplugin.h>
#include "bolt.h"
#include "bowl.h"
#include "gear.h"
#include "nut.h"
#include "torus.h"
namespace mujoco::plugin::sdf {
mjPLUGIN_LIB_INIT(sdf) {
Bolt::RegisterPlugin();
Bowl::RegisterPlugin();
Gear::RegisterPlugin();
Nut::RegisterPlugin();
Torus::RegisterPlugin();
}
} // namespace mujoco::plugin::sdf