[ expat-Bugs-923913 ] Calling convention problems

"SourceForge.net" <[email protected]>
Newsgroups gmane.text.xml.expat.bugs
Message-ID <[email protected]>
Bugs item #923913, was opened at 2004-03-26 09:33
Message generated for change (Comment added) made by fdrake
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=923913&group_id=10127

Category: None
Group: Test Required
>Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Karl Waclawek (kwaclaw)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Calling convention problems

Initial Comment:
Two problems I found in Windows, when trying to define 
XMLCALL as __stdcall:

1) 
In Expat.h, this struct is defined:

typedef struct {
  int map[256];
  void *data;
  int (XMLCALL *convert)(void *data, const char *s);
  void (XMLCALL *release)(void *data);
} XML_Encoding;

in xmltok.h, this function pointer is defined:

  typedef int (*CONVERTER) (void *userData, const char 
*p);

which maps to the third struct member.
So, if the calling convention in XMLCALL is different from
the default, we have a type mismatch.

2) 
In expat.h, we define the calling convention for
the memory handling function pointers like this:

typedef struct {
  void *(XMLCALL *malloc_fcn)(size_t size);
  void *(XMLCALL *realloc_fcn)(void *ptr, size_t size);
  void (XMLCALL *free_fcn)(void *ptr);
} XML_Memory_Handling_Suite;

However, when none are provided by the application, 
we are assigning the standard memory allocation 
functions to it. Which creates a problems, as these 
always have the same calling convention.

Suggested solutions:
1) Remove external API definitions from expat.h and
move them into a file external.h, that can be included
by other files that also have a dependency on the 
external API.

2) Remove XMLCALL from the function pointer
definitions in the memory handling struct.


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

>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2004-07-15 19:45

Message:
Logged In: YES 
user_id=3066

Works for me.

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

Comment By: Karl Waclawek (kwaclaw)
Date: 2004-03-26 09:36

Message:
Logged In: YES 
user_id=290026

Committed a fix for this:

Checking in expat.dsp;
/cvsroot/expat/expat/lib/expat.dsp,v  <--  expat.dsp
new revision: 1.11; previous revision: 1.10
done
Checking in expat.h;
/cvsroot/expat/expat/lib/expat.h,v  <--  expat.h
new revision: 1.66; previous revision: 1.65
done
Checking in expat_static.dsp;
/cvsroot/expat/expat/lib/expat_static.dsp,v  <--  
expat_static.dsp
new revision: 1.3; previous revision: 1.2
done
Checking in expatw.dsp;
/cvsroot/expat/expat/lib/expatw.dsp,v  <--  expatw.dsp
new revision: 1.4; previous revision: 1.3
done
Checking in expatw_static.dsp;
/cvsroot/expat/expat/lib/expatw_static.dsp,v  <--  
expatw_static.dsp
new revision: 1.3; previous revision: 1.2
done
RCS file: /cvsroot/expat/expat/lib/external.h,v
done
Checking in external.h;
/cvsroot/expat/expat/lib/external.h,v  <--  external.h
initial revision: 1.1
done
Checking in xmlparse.c;
/cvsroot/expat/expat/lib/xmlparse.c,v  <--  xmlparse.c
new revision: 1.130; previous revision: 1.129
done
Checking in xmlrole.c;
/cvsroot/expat/expat/lib/xmlrole.c,v  <--  xmlrole.c
new revision: 1.17; previous revision: 1.16
done
Checking in xmltok.c;
/cvsroot/expat/expat/lib/xmltok.c,v  <--  xmltok.c
new revision: 1.30; previous revision: 1.29
done
Checking in xmltok.h;
/cvsroot/expat/expat/lib/xmltok.h,v  <--  xmltok.h
new revision: 1.10; previous revision: 1.9
done


Assigned to Fred, for testing on Linux.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=923913&group_id=10127
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.