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 <wm...@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
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice