summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx11
2 files changed, 9 insertions, 4 deletions
diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx b/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx
index b5661d003752..cbd6e2afa40d 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx
@@ -37,7 +37,7 @@
namespace CPPU_CURRENT_NAMESPACE
{
-bool isSimpleReturnType(typelib_TypeDescription * pTD);
+bool isSimpleReturnType(typelib_TypeDescription * pTD, bool recursive = false);
void dummy_can_throw_anything( char const * );
diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx
index caa8e8520d28..3fd38cc9af41 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx
@@ -347,17 +347,22 @@ static void cpp_call(
}
namespace CPPU_CURRENT_NAMESPACE {
-bool isSimpleReturnType(typelib_TypeDescription * pTD)
+bool isSimpleReturnType(typelib_TypeDescription * pTD, bool recursive)
{
if (bridges::cpp_uno::shared::isSimpleType( pTD ))
return true;
- if (pTD->eTypeClass == typelib_TypeClass_STRUCT && pTD->nSize <= 8) {
+ // Only structs of exactly 1, 2, 4, or 8 bytes are returned through
+ // registers, see <http://developer.apple.com/documentation/DeveloperTools/
+ // Conceptual/LowLevelABI/Articles/IA32.html>:
+ if (pTD->eTypeClass == typelib_TypeClass_STRUCT &&
+ (recursive || pTD->nSize <= 2 || pTD->nSize == 4 || pTD->nSize == 8))
+ {
typelib_CompoundTypeDescription *const pCompTD =
(typelib_CompoundTypeDescription *) pTD;
for ( sal_Int32 pos = pCompTD->nMembers; pos--; ) {
typelib_TypeDescription * pMemberTD = 0;
TYPELIB_DANGER_GET( &pMemberTD, pCompTD->ppTypeRefs[pos] );
- bool const b = isSimpleReturnType(pMemberTD);
+ bool const b = isSimpleReturnType(pMemberTD, true);
TYPELIB_DANGER_RELEASE( pMemberTD );
if (! b)
return false;