[Expat-discuss] c++-ize expat
m.
michal017 at centrum.sk
Mon Jun 30 17:38:02 EDT 2003
Give us an example..
m.
On Mon, 30 Jun 2003 18:26:45 +0530
"Gururajan, Subhashini (Cognizant)" <GSubhash at chn.cognizant.com> wrote:
>Hi,
>Why is it that I get junk characters in handler sometimes. Because of this the parser fails. Please help me out. It is very inconsistent.
>
>Please ... somebody..
>
>-subha
>
>-----Original Message-----
>From: m. [mailto:michal017 at centrum.sk]
>Sent: Wednesday, June 25, 2003 11:25 AM
>To: expat-discuss at libexpat.org
>Subject: Re: [Expat-discuss] c++-ize expat
>
>
>You know what? You are entirely right..
>This information was based on my colleague's knowledge, I should have tested
>it before I posted a question.. My apologies
>michal
>
>On Tue, 24 Jun 2003 23:29:01 +0100
>Graham Bennett <graham-expat at simulcra.org> wrote:
>
>>On Tue, Jun 24, 2003 at 02:38:21PM +0200, m. wrote:
>>> Hello.. I am wondering whether it is possible to c++-ize expat's code
>>> so that it could be compiled with c++ compiler. The reason for this
>>> is the ability to throw exceptions from callback functions. I have to
>>> remove all the 'extern "C"' stuff from expat code and cast all the
>>> void* to FILE* and so on.. Could this be done in the default expat's
>>> code?
>>
>>In order to use expat from C++ code it is not necessary to compile with
>>g++. All that you need is to compile with gcc with the -fexceptions
>>flag. This generates the necessary stack unwinding code to allow
>>exceptions to be thrown.
>>
>>IIRC, the expat configure script will enable the -fexceptions flag if it
>>detects the compiler is gcc (even though it checks for -fno-exceptions).
>>Try it and see.
>>
>>I have used expat from C++ code compiled in this way and I've had no
>>problems throwing exceptions through expat code.
>>
>>cheers,
>>
>>--
>>Graham Bennett
>>
>>
>
>_______________________________________________
>Expat-discuss mailing list
>Expat-discuss at libexpat.org
>http://mail.libexpat.org/mailman/listinfo/expat-discuss
>
More information about the Expat-discuss
mailing list