[Expat-bugs] [ expat-Bugs-413653 ] XMLPARSERAPI and __cdecl

noreply@sourceforge.net noreply@sourceforge.net
Wed, 04 Apr 2001 01:10:24 -0700


Bugs item #413653, was updated on 2001-04-04 01:00
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=413653&group_id=10127

Category: Build control
Group: Platform Specific
Status: Open
Priority: 5
Submitted By: Matthew Versluys (styxlord)
Assigned to: Nobody/Anonymous (nobody)
Summary: XMLPARSERAPI and __cdecl

Initial Comment:
If before including expath.h XMLPARSERAPI is defined 
to __declspec(dllimport) __cdecl which is required if 
you are building a project with fastcall calling 
convention the following errors result.

expat.h(548) : error C2165: 'left-side modifier' : 
cannot modify pointers to data
expat.h(574) : error C2165: 'left-side modifier' : 
cannot modify pointers to data
expat.h(689) : error C2165: 'left-side modifier' : 
cannot modify pointers to data
Include\expat.h(702) : error C2165: 'left-side 
modifier' : cannot modify pointers to data
Include\expat.h(706) : error C2165: 'left-side 
modifier' : cannot modify pointers to data

Which is the result of the XMLPARSEAPI definition 
apearing between the return type and the * modifier 
indicating that the return type is a pointer.  By 
moving XMLPARSEAPI to the right hand side of the * 
modifier the problem is resolved.

This is using expat_win32bin 1.95.1 with Microsoft 
Visual Studio 6.0 SP4.

----------------------------------------------------------------------

>Comment By: Matthew Versluys (styxlord)
Date: 2001-04-04 01:10

Message:
Logged In: YES 
user_id=188602

Of course, now that I'm awake this doesn't produce the 
desired result anyhow since it now ignores the __declspec
(dllimport) for those functions.  The real fix is the have 
an XMLPARSEDECL definition which appears before the return 
arguments to the functions which is where the __declspec
(import) belongs and the __cdecl is used with XMLPARSEAPI.

The expat_win32bin 1.95.1 package doesn't include an import 
library so the functions need to be manually bound using 
LoadLibrary, GetProcAddress anyhow.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=110127&aid=413653&group_id=10127