From: Devin S. <dev...@gm...> - 2009-05-02 00:09:15
|
Hi, How exactly does INITGUID ever get defined? I have this in my header file: #include <objbase.h> #include <initguid.h> /* Define the library ID (LIBID) */ DEFINE_GUID(LIBID_mingwcom, 0x6fc10990,0xbc73,0x4dff,0xab, 0x63, 0xdf, 0xb1, 0x86, 0x8, 0x1e, 0x81); Since INITGUID never gets defined the preprocessor converts this DEFINE_GUID into extern const GUID LIBID_mingwcom = {0x6fc10990,0xbc73,0x4dff,{0xab,0x63,0xdf,0xb1,0x86,0x8,0x1e,0x81}}; and this causes a warning with gcc: warning: `LIBID_mingwcom' initialized and declared `extern' Now I can fix this by going into include/basetyps.h around line 170 and flipping the !defined(INITGUID) to a defined(INITGUID) and the warning goes away. This seems like a bad solution though. What is the correct solution? In this file, around line 170 we have: #if !defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus)) #define GUID_EXT EXTERN_C #else #define GUID_EXT #endif The change flips it to: #if defined(INITGUID) || (defined(INITGUID) && defined(__cplusplus)) #define GUID_EXT EXTERN_C #else #define GUID_EXT #endif Thanks in advance, Devin Smith |