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
This commit is contained in:
committed by
Copybara-Service
parent
33fd2fe40e
commit
f2461f9ce6
@@ -17,7 +17,7 @@
|
||||
|
||||
namespace mujoco::plugin::sensor {
|
||||
|
||||
mjPLUGIN_LIB_INIT {
|
||||
mjPLUGIN_LIB_INIT(sensor) {
|
||||
TouchGrid::RegisterPlugin();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user