#include <switch.h>\r
#include <switch_cpp.h>\r
\r
-typedef void (*hangupFunction)(void);\r
-typedef char* (*inputFunction)(void*, switch_input_type_t);\r
+/* calling conventions for Windows */
+#ifndef MANAGED_STDCALL
+#ifdef WIN32
+# define MANAGED_STDCALL __stdcall
+# else
+# define MANAGED_STDCALL
+# endif
+#endif
+\r
+typedef void (MANAGED_STDCALL *hangupFunction)(void);\r
+typedef char* (MANAGED_STDCALL *inputFunction)(void*, switch_input_type_t);\r
\r
\r
#ifndef _MANAGED\r
mod_managed_globals globals = { 0 };\r
\r
// Global delegates to call managed functions\r
-typedef int (*runFunction)(const char *data, void *sessionPtr);\r
-typedef int (*executeFunction)(const char *cmd, void *stream, void *Event);\r
-typedef int (*executeBackgroundFunction)(const char* cmd);\r
-typedef int (*loadAssemblyFunction)(const char* filename);\r
+typedef int (MANAGED_STDCALL *runFunction)(const char *data, void *sessionPtr);\r
+typedef int (MANAGED_STDCALL *executeFunction)(const char *cmd, void *stream, void *Event);\r
+typedef int (MANAGED_STDCALL *executeBackgroundFunction)(const char* cmd);\r
+typedef int (MANAGED_STDCALL *loadAssemblyFunction)(const char* filename);\r
static runFunction runDelegate;\r
static executeFunction executeDelegate;\r
static executeBackgroundFunction executeBackgroundDelegate;\r