]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak calling conventions.
authorMichael Jerris <mike@jerris.com>
Thu, 23 Oct 2008 03:57:16 +0000 (03:57 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 23 Oct 2008 03:57:16 +0000 (03:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10124 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_managed/freeswitch_managed.h
src/mod/languages/mod_managed/mod_managed.cpp

index 477ca82b0b60dcc5f308c5bbd28130b1839eb51b..31d36ef721818c6e45f06af1b03d8f0ffad27ad5 100644 (file)
@@ -38,8 +38,17 @@ SWITCH_BEGIN_EXTERN_C
 #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
index b2ad33c0169fecf33d69dfe7b71cabd1f79e8d26..7f2d366e532bbe3ab0270ae11b714d4c24e1da15 100644 (file)
@@ -68,10 +68,10 @@ SWITCH_STANDARD_API(managed_loadassembly); /* Load assembly */
 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