diff --git a/rcldotnet/rcldotnet_macros.h b/rcldotnet/rcldotnet_macros.h index d80c676f..2b0800d1 100644 --- a/rcldotnet/rcldotnet_macros.h +++ b/rcldotnet/rcldotnet_macros.h @@ -18,11 +18,19 @@ #if defined(_MSC_VER) #define RCLDOTNET_EXPORT __declspec(dllexport) #define RCLDOTNET_IMPORT __declspec(dllimport) - #define RCLDOTNET_CDECL __cdecl + #if defined(_M_IX86) + #define RCLDOTNET_CDECL __cdecl + #else + #define RCLDOTNET_CDECL + #endif #elif defined(__GNUC__) #define RCLDOTNET_EXPORT __attribute__((visibility("default"))) #define RCLDOTNET_IMPORT - #define RCLDOTNET_CDECL __attribute__((__cdecl__)) + #if defined(__i386__) + #define RCLDOTNET_CDECL __attribute__((__cdecl__)) + #else + #define RCLDOTNET_CDECL + #endif #else #define RCLDOTNET_EXPORT #define RCLDOTNET_IMPORT diff --git a/rcldotnet_examples/CMakeLists.txt b/rcldotnet_examples/CMakeLists.txt index d2383d34..64d64f89 100644 --- a/rcldotnet_examples/CMakeLists.txt +++ b/rcldotnet_examples/CMakeLists.txt @@ -23,8 +23,6 @@ set(_assemblies_dep_dlls ${std_srvs_ASSEMBLIES_DLL} ) -message("Included assemblies: ${_assemblies_dep_dlls}") - add_dotnet_executable(rcldotnet_talker RCLDotnetTalker.cs INCLUDE_DLLS diff --git a/rosidl_generator_dotnet/resource/msg.h.em b/rosidl_generator_dotnet/resource/msg.h.em index 2d113edb..a81516f3 100644 --- a/rosidl_generator_dotnet/resource/msg.h.em +++ b/rosidl_generator_dotnet/resource/msg.h.em @@ -18,12 +18,20 @@ msg_prefix = "RCLDOTNET_{0}_{1}_{2}".format(package_name, '_'.join(message.struc // Microsoft #define @(msg_prefix)_EXPORT __declspec(dllexport) #define @(msg_prefix)_IMPORT __declspec(dllimport) - #define @(msg_prefix)_CDECL __cdecl + #if defined(_M_IX86) + #define @(msg_prefix)_CDECL __cdecl + #else + #define @(msg_prefix)_CDECL + #endif #elif defined(__GNUC__) // GCC #define @(msg_prefix)_EXPORT __attribute__((visibility("default"))) #define @(msg_prefix)_IMPORT - #define @(msg_prefix)_CDECL __attribute__((__cdecl__)) + #if defined(__i386__) + #define @(msg_prefix)_CDECL __attribute__((__cdecl__)) + #else + #define @(msg_prefix)_CDECL + #endif #else // do nothing and hope for the best? #define @(msg_prefix)_EXPORT diff --git a/rosidl_generator_dotnet/resource/srv.h.em b/rosidl_generator_dotnet/resource/srv.h.em index 46c279ba..047333f7 100644 --- a/rosidl_generator_dotnet/resource/srv.h.em +++ b/rosidl_generator_dotnet/resource/srv.h.em @@ -7,12 +7,20 @@ srv_prefix = "RCLDOTNET_{0}_{1}_{2}".format(package_name, '_'.join(service.names // Microsoft #define @(srv_prefix)_EXPORT __declspec(dllexport) #define @(srv_prefix)_IMPORT __declspec(dllimport) - #define @(srv_prefix)_CDECL __cdecl + #if defined(_M_IX86) + #define @(srv_prefix)_CDECL __cdecl + #else + #define @(srv_prefix)_CDECL + #endif #elif defined(__GNUC__) // GCC #define @(srv_prefix)_EXPORT __attribute__((visibility("default"))) #define @(srv_prefix)_IMPORT - #define @(srv_prefix)_CDECL __attribute__((__cdecl__)) + #if defined(__i386__) + #define @(srv_prefix)_CDECL __attribute__((__cdecl__)) + #else + #define @(srv_prefix)_CDECL + #endif #else // do nothing and hope for the best? #define @(srv_prefix)_EXPORT