Declare DllMain as extern "C".
Fixes #550. PiperOrigin-RevId: 484540205 Change-Id: I3915f65f1ae6ab3a93118b9d747b5c09d9abe872
This commit is contained in:
committed by
Copybara-Service
parent
8db949ac19
commit
c7960385be
@@ -72,15 +72,23 @@ typedef struct mjpPlugin_ mjpPlugin;
|
|||||||
#define mjDLLMAIN DllMain
|
#define mjDLLMAIN DllMain
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(mjEXTERNC)
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
#define mjEXTERNC extern "C"
|
||||||
|
#else
|
||||||
|
#define mjEXTERNC
|
||||||
|
#endif // defined(__cplusplus)
|
||||||
|
#endif // !defined(mjEXTERNC)
|
||||||
|
|
||||||
// NOLINTBEGIN(runtime/int)
|
// NOLINTBEGIN(runtime/int)
|
||||||
#define mjPLUGIN_DYNAMIC_LIBRARY_INIT \
|
#define mjPLUGIN_DYNAMIC_LIBRARY_INIT \
|
||||||
static void _mjplugin_dllmain(void); \
|
static void _mjplugin_dllmain(void); \
|
||||||
static int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \
|
mjEXTERNC int __stdcall mjDLLMAIN(void* hinst, unsigned long reason, void* reserved) { \
|
||||||
if (reason == 1) { \
|
if (reason == 1) { \
|
||||||
_mjplugin_dllmain(); \
|
_mjplugin_dllmain(); \
|
||||||
} \
|
} \
|
||||||
return 1; \
|
return 1; \
|
||||||
} \
|
} \
|
||||||
static void _mjplugin_dllmain(void)
|
static void _mjplugin_dllmain(void)
|
||||||
// NOLINTEND(runtime/int)
|
// NOLINTEND(runtime/int)
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ public const int mjNREF = 2;
|
|||||||
public const int mjNIMP = 5;
|
public const int mjNIMP = 5;
|
||||||
public const int mjNSOLVER = 1000;
|
public const int mjNSOLVER = 1000;
|
||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJPLUGIN_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJPLUGIN_H_ = true;
|
||||||
|
public const bool mjEXTERNC = true;
|
||||||
public const bool THIRD_PARTY_MUJOCO_MJRENDER_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_MJRENDER_H_ = true;
|
||||||
public const int mjNAUX = 10;
|
public const int mjNAUX = 10;
|
||||||
public const int mjMAXTEXTURE = 1000;
|
public const int mjMAXTEXTURE = 1000;
|
||||||
|
|||||||
Reference in New Issue
Block a user