|
From: Mauricio G. <mgp...@gm...> - 2009-08-25 00:27:53
|
Hi, I have encountered this problem while compiling webconnect ( http://www.kirix.com/labs/wxwebconnect/downloads.html). I am using mingw 5.1.4 with Code::Blocks. Please consider the following code: #include <stddef.h> #define NS_ISUPPORTS_IID \ {0x00000000, 0x0000, 0x0000, \ { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }} #define NS_DECLARE_STATIC_IID_ACCESSOR(iid) \ static const nsIID& GetIID() { \ static nsIID nsiid = iid; \ return nsiid; \ } #define NS_DEFINE_STATIC_IID_ACCESSOR(iid) NS_DECLARE_STATIC_IID_ACCESSOR(iid) struct nsID { long m0; int m1; int m2; unsigned char m3[8]; }; typedef nsID nsIID; class c { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID) // This compiles okay. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID) // This does not compile. }; Could somebody please explain to me why the "last" line does not compile ? c:\projects\webconnect\lixo.cpp|30|macro "NS_DECLARE_STATIC_IID_ACCESSOR" passed 11 arguments, but takes just 1| c:\projects\webconnect\lixo.cpp|31|error: ISO C++ forbids declaration of `NS_DECLARE_STATIC_IID_ACCESSOR' with no type| c:\projects\webconnect\lixo.cpp|31|error: expected `;' before '}' token| c:\projects\webconnect\lixo.cpp|31|error: expected `;' before '}' token| ||=== Build finished: 4 errors, 0 warnings ===| Thank you for your attention, Mauricio. -- Mauricio Gomes Pensar Digital 55-11-9698-1683 (Brazil - mobile) |