On 7/11/12, Kai Tietz <[email protected]> wrote: > 2012/7/11 JonY <[email protected]>: >> On 7/11/2012 14:51, Peter Schaefer wrote: >>> Hi! >>> >>> I'm using the recent rubenvb-gcc-4.7.1 release and tried to compile an >>> application using TAPI, however tapi.h cannot be >>> compiled: >>> >>>> c:\mingw32\bin\../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/include/tapi.h:2074:107: >>>> error: declaration of C function 'LONG lineAddProviderW(LPCWSTR, HWND, >>>> LPDWORD)' conflicts with >>>> c:\mingw32\bin\../lib/gcc/i686-w64-mingw32/4.7.1/../../../../i686-w64-mingw32/include/tapi.h:2072:1: >>>> error: previous declaration 'LONG lineAddProviderW(LPCSTR, HWND, >>>> LPDWORD)' here >>> >>> This is because the whole list of >>> >>>> #define yadayada __MINGW_NAME_AW(yadayada) >>> >>> is located *before* the function declarations and the expansion of the >>> __MINGW_NAME_AW macro leads to name clashes. >>> >> >> >> No, it is fine to have those macros before. > > sure, I have no objections about this. > > Cheers, > Kai >
Ok looked at the header and reproduced the error. The specific problem with tapi.h and the unicode macros is that some functions have their xxxA/xxxW variants _along_ with the ones without them: e.g. we have lineUnpark() _and_ lineUnparkA() and lineUnparkW() This is because the developer mayl target an older tapi version as is bare minimum, hence the TAPI_CURRENT_VERSION macro: If unicode: the name is supposed to be defined to as the W variant, if not: only if TAPI_CURRENT_VERSION>=0x0x00020000 then it is to be defined as the A variant, else left as is, i.e. lineUnpark() itself will be used and linked. In any case, the unicode macros must really be moved after the prototypes. Pushed lib32/tapi32.def update to trunk at rev.5204, to stable/v1.x at rev. 5205 and to stable/v2.x at rev. 5206, so linkage should work fine now. -- O.S. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
