Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


clang flags this as

/home/wmk26/libo-git/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx:91:91:
error: cannot initialize a member subobject of type
'CardPropertyGetter' (aka 'nsresult (nsIAbCard::*)(PRUnichar **)')
with an rvalue of type 'nsresult (nsIAbCard::*)(PRUnichar **)
__attribute__((cdecl))'
                    { "FirstName",          "givenname",

I did a grep for NS_STDCALL and chanced upon this comment in
moz/unxlngi6.pro/misc/build/mozilla/xpcom/base/nscore.h

/**
 * Macro for creating typedefs for pointer-to-member types which are
 * declared with stdcall.  It is important to use this for any type which is
 * declared as stdcall (i.e. NS_IMETHOD).  For example, instead of writing:
 *
 *  typedef nsresult (nsIFoo::*someType)(nsISupports* arg);
 *
 *  you should write:
 *
 *  typedef
 *  NS_STDCALL_FUNCPROTO(nsresult, someType, nsIFoo, typeFunc, (nsISupports*));

Hopefully the patch is correct. I didn't try building in with gcc, but
clang seems to be pleased..

Regards,
Wei Ming
From 85fe9121b1a482d8b409ce8e4c9f8536fe1b213d Mon Sep 17 00:00:00 2001
From: Wei Ming Khoo <wmk26@cam.ac.uk>
Date: Fri, 17 Feb 2012 15:25:25 +0000
Subject: [PATCH] Clang-flagged error for typedef of CardPropertyGetter/Setter

---
 .../drivers/mozab/mozillasrc/MLdapAttributeMap.cxx |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx 
b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
index e15da07..4fbb10b 100644
--- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
+++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
@@ -48,8 +48,8 @@ namespace connectivity { namespace mozab {
     //====================================================================
     namespace
     {
-        typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertyGetter)( PRUnichar** aFirstName );
-        typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertySetter)( const PRUnichar* aFirstName 
);
+        typedef NS_STDCALL_FUNCPROTO(nsResult, CardPropertyGetter, nsIAbCard, GetFirstName, 
(PRUnichar**));
+        typedef NS_STDCALL_FUNCPROTO(nsResult, CardPropertySetter, nsIAbCard, SetFirstName, (const 
PRUnichar*));
         struct CardPropertyData
         {
             const sal_Char*     pLDAPAttributeList;
-- 
1.7.4.1


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.