fix windows calling conventions for modules with sub-modules broken in svn r12919

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12960 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-04-09 15:28:52 +00:00
parent 5407a812cf
commit 2840f826f0
8 changed files with 14 additions and 8 deletions

View File

@ -145,13 +145,16 @@ typedef int gid_t;
#define SWITCH_DECLARE_DATA __declspec(dllimport) #define SWITCH_DECLARE_DATA __declspec(dllimport)
#endif #endif
#if defined(SWITCH_MOD_DECLARE_STATIC) #if defined(SWITCH_MOD_DECLARE_STATIC)
#define SWITCH_MOD_DECLARE(type) type __cdecl #define SWITCH_MOD_DECLARE(type) type __stdcall
#define SWITCH_MOD_DECLARE_NONSTD(type) type __cdecl
#define SWITCH_MOD_DECLARE_DATA #define SWITCH_MOD_DECLARE_DATA
#elif defined(MOD_EXPORTS) #elif defined(MOD_EXPORTS)
#define SWITCH_MOD_DECLARE(type) __declspec(dllexport) type __stdcall #define SWITCH_MOD_DECLARE(type) __declspec(dllexport) type __stdcall
#define SWITCH_MOD_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl
#define SWITCH_MOD_DECLARE_DATA __declspec(dllexport) #define SWITCH_MOD_DECLARE_DATA __declspec(dllexport)
#else #else
#define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __stdcall #define SWITCH_MOD_DECLARE(type) __declspec(dllimport) type __stdcall
#define SWITCH_MOD_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl
#define SWITCH_MOD_DECLARE_DATA __declspec(dllimport) #define SWITCH_MOD_DECLARE_DATA __declspec(dllimport)
#endif #endif
#define SIGHUP SIGTERM #define SIGHUP SIGTERM
@ -170,6 +173,7 @@ typedef int gid_t;
#define SWITCH_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type #define SWITCH_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
#define SWITCH_DECLARE_DATA __attribute__((visibility("default"))) #define SWITCH_DECLARE_DATA __attribute__((visibility("default")))
#define SWITCH_MOD_DECLARE(type) __attribute__((visibility("default"))) type #define SWITCH_MOD_DECLARE(type) __attribute__((visibility("default"))) type
#define SWITCH_MOD_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type
#define SWITCH_MOD_DECLARE_DATA __attribute__((visibility("default"))) #define SWITCH_MOD_DECLARE_DATA __attribute__((visibility("default")))
#define SWITCH_DECLARE_CLASS __attribute__((visibility("default"))) #define SWITCH_DECLARE_CLASS __attribute__((visibility("default")))
#else #else
@ -177,6 +181,7 @@ typedef int gid_t;
#define SWITCH_DECLARE_NONSTD(type) type #define SWITCH_DECLARE_NONSTD(type) type
#define SWITCH_DECLARE_DATA #define SWITCH_DECLARE_DATA
#define SWITCH_MOD_DECLARE(type) type #define SWITCH_MOD_DECLARE(type) type
#define SWITCH_MOD_DECLARE_NONSTD(type) type
#define SWITCH_MOD_DECLARE_DATA #define SWITCH_MOD_DECLARE_DATA
#define SWITCH_DECLARE_CLASS #define SWITCH_DECLARE_CLASS
#endif #endif

View File

@ -77,7 +77,7 @@ static executeFunction executeDelegate;
static executeBackgroundFunction executeBackgroundDelegate; static executeBackgroundFunction executeBackgroundDelegate;
static loadAssemblyFunction loadAssemblyDelegate; static loadAssemblyFunction loadAssemblyDelegate;
SWITCH_MOD_DECLARE(void) InitManagedDelegates(runFunction run, executeFunction execute, executeBackgroundFunction executeBackground, loadAssemblyFunction loadAssembly) SWITCH_MOD_DECLARE_NONSTD(void) InitManagedDelegates(runFunction run, executeFunction execute, executeBackgroundFunction executeBackground, loadAssemblyFunction loadAssembly)
{ {
runDelegate = run; runDelegate = run;
executeDelegate = execute; executeDelegate = execute;
@ -88,7 +88,7 @@ SWITCH_MOD_DECLARE(void) InitManagedDelegates(runFunction run, executeFunction e
// Sets up delegates (and anything else needed) on the ManagedSession object // Sets up delegates (and anything else needed) on the ManagedSession object
// Called from ManagedSession.Initialize Managed -> this is Unmanaged code so all pointers are marshalled and prevented from GC // Called from ManagedSession.Initialize Managed -> this is Unmanaged code so all pointers are marshalled and prevented from GC
// Exported method. // Exported method.
SWITCH_MOD_DECLARE(void) InitManagedSession(ManagedSession *session, inputFunction dtmfDelegate, hangupFunction hangupDelegate) SWITCH_MOD_DECLARE_NONSTD(void) InitManagedSession(ManagedSession *session, inputFunction dtmfDelegate, hangupFunction hangupDelegate)
{ {
switch_assert(session); switch_assert(session);
if (!session) { if (!session) {

View File

@ -31,6 +31,7 @@ typedef unsigned long in_addr_t;
#define SWITCH_DECLARE(type) type #define SWITCH_DECLARE(type) type
#define SWITCH_DECLARE_NONSTD(type) type #define SWITCH_DECLARE_NONSTD(type) type
#define SWITCH_MOD_DECLARE(type) type #define SWITCH_MOD_DECLARE(type) type
#define SWITCH_MOD_DECLARE_NONSTD(type) type
#define SWITCH_DECLARE_DATA #define SWITCH_DECLARE_DATA
#define SWITCH_MOD_DECLARE_DATA #define SWITCH_MOD_DECLARE_DATA
#define SWITCH_THREAD_FUNC #define SWITCH_THREAD_FUNC

View File

@ -332,7 +332,7 @@ const sm_module_interface_t DB_module_interface = {
/*.next */ NULL /*.next */ NULL
}; };
SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface) SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
{ {
*module_interface = &DB_module_interface; *module_interface = &DB_module_interface;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;

View File

@ -240,7 +240,7 @@ const sm_module_interface_t curl_module_interface = {
/*.next */ NULL /*.next */ NULL
}; };
SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface) SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
{ {
curl_global_init(CURL_GLOBAL_ALL); curl_global_init(CURL_GLOBAL_ALL);
*module_interface = &curl_module_interface; *module_interface = &curl_module_interface;

View File

@ -533,7 +533,7 @@ const sm_module_interface_t odbc_module_interface = {
/*.next */ NULL /*.next */ NULL
}; };
SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface) SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
{ {
*module_interface = &odbc_module_interface; *module_interface = &odbc_module_interface;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;

View File

@ -324,7 +324,7 @@ const sm_module_interface_t socket_module_interface = {
/*.next */ NULL /*.next */ NULL
}; };
SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface) SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
{ {
*module_interface = &socket_module_interface; *module_interface = &socket_module_interface;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;

View File

@ -346,7 +346,7 @@ const sm_module_interface_t teletone_module_interface = {
/*.next */ NULL /*.next */ NULL
}; };
SWITCH_MOD_DECLARE(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface) SWITCH_MOD_DECLARE_NONSTD(switch_status_t) spidermonkey_init(const sm_module_interface_t **module_interface)
{ {
*module_interface = &teletone_module_interface; *module_interface = &teletone_module_interface;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;