Adding `extern "C"` to HL_PRIM if using CPP
@@ -712,7 +712,11 @@ typedef struct {
#define HL_PRIM
#define DEFINE_PRIM_WITH_NAME(t,name,args,realName)
#else
+# ifdef __cplusplus
+# define HL_PRIM extern "C" EXPORT
+# else
# define HL_PRIM EXPORT
+# endif
# define DEFINE_PRIM_WITH_NAME _DEFINE_PRIM_WITH_NAME
#endif
