[Expat-bugs] [ expat-Bugs-622436 ] Static lib with other calling convention

noreply@sourceforge.net noreply@sourceforge.net
Sat, 12 Oct 2002 13:45:43 -0700


Bugs item #622436, was opened at 2002-10-12 13:45
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=622436&group_id=10127

Category: None
Group: Platform Specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Static lib with other calling convention

Initial Comment:
Windows/Visual C++ 6.0

If you try to build the static lib with another default 
calling convention (__stdcall) or try using the given lib in 
a context where the calling convention is not __cdecl 
you have to apply the following changes.
Reason: malloc(), realloc() and free() have always the 
__cdecl calling convention, and so 
XML_Memory_Handling_Suite must use the same.

In file expat.h

replace line 185-187

  void *(*malloc_fcn)(size_t size);
  void *(*realloc_fcn)(void *ptr, size_t size);
  void (*free_fcn)(void *ptr);

with

  void *(__cdecl *malloc_fcn)(size_t size);
  void *(__cdecl *realloc_fcn)(void *ptr, size_t size);
  void (__cdecl *free_fcn)(void *ptr);



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

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