From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13421 invoked by alias); 21 Feb 2013 15:19:49 -0000 Received: (qmail 13413 invoked by uid 22791); 21 Feb 2013 15:19:48 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BF X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Feb 2013 15:19:39 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1LFJcHL020180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Feb 2013 10:19:38 -0500 Received: from zebedee.pink (ovpn-113-141.phx2.redhat.com [10.3.113.141]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r1LFJakx014124; Thu, 21 Feb 2013 10:19:37 -0500 Message-ID: <51263B08.50904@redhat.com> Date: Thu, 21 Feb 2013 15:19:00 -0000 From: Andrew Haley User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Philip Ashmore CC: libffi-discuss@sourceware.org Subject: Re: Calling c++ functions returning non-pod types References: <5126214C.2090909@philipashmore.com> In-Reply-To: <5126214C.2090909@philipashmore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org X-SW-Source: 2013/txt/msg00072.txt.bz2 On 02/21/2013 01:29 PM, Philip Ashmore wrote: > I think a better option would be to tell libffi that the return type is > a "non-pod" and let it jump the hoops appropriate for the architecture - > am I correct in guessing that my approach isn't portable? Sort of. There is a standardish C++ ABI known for reasons too arcane to go into as the Itanium C++ ABI http://refspecs.linux-foundation.org/cxxabi-1.83.html However, putting all this stuff into libffi would be too much IMO. You could think of defining a C++ layer that calls libffi. Andrew.