Last night, I was trying to compile Xerces 2.1.0 on Irix 6.5.16 (or is it
.17?) with g++ 3.0.4.  I found that in the IRIXPlatformUtils.cpp, three
methods were missing.  openFileToWrite(2x), and writeBufferToFile.  Was this
intentional, or an oversight?  I got it to work by copying the functions 
from Linux and praying a lot. ;)

I also noticed then that it worked, but always dumped core. I traced down 
the bug to the fact that it is trying to free semaphores AFTER it frees the 
arena. I put some sanity checking in, but it still doesn't solve the 
problem, just work around it. 

Anyway, here is the patch.  Maybe it will be useful. :)

-Richard Balint
Ball Aerospace & Technologies
(and Hackswell.com is my personal address, not my work account. ;)




diff -r xerces-c-src2_1_0.orig/samples/Makefile.incl 
xerces-c-src2_1_0/samples/Makefile.incl
86c86
<       PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib -L/usr/local/lib
---
>       PLATFORM_LIB_LINK_OPTIONS=-L/usr/lib32 -L/usr/local/lib
diff -r xerces-c-src2_1_0.orig/src/xercesc/util/Platforms/IRIX/IRIXPlatformUtils.cpp 
xerces-c-src2_1_0/src/xercesc/util/Platforms/IRIX/IRIXPlatformUtils.cpp
321a322,335
> FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName)
> {
>     const char* tmpFileName = XMLString::transcode(fileName);
>     ArrayJanitor<char> janText((char*)tmpFileName);
>     return fopen( tmpFileName , "wb" );
> }
> 
> FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName)
> {
>     return fopen( fileName , "wb" );
> }
> 
> 
> 
345a360,396
> 
> void
> XMLPlatformUtils::writeBufferToFile( FileHandle     const  theFile
>                                    , long                  toWrite
>                                    , const XMLByte* const  toFlush)
> {
>     if (!theFile        ||
>         (toWrite <= 0 ) ||
>         !toFlush         )
>         return;
> 
>     const XMLByte* tmpFlush = (const XMLByte*) toFlush;
>     size_t bytesWritten = 0;
> 
>     while (true)
>     {
>         bytesWritten=fwrite(tmpFlush, sizeof(XMLByte), toWrite, (FILE*)theFile);
> 
>         if(ferror((FILE*)theFile))
>         {
>             ThrowXML(XMLPlatformUtilsException, 
>XMLExcepts::File_CouldNotWriteToFile);
>         }
> 
>         if (bytesWritten < toWrite) //incomplete write
>         {
>             tmpFlush+=bytesWritten;
>             toWrite-=bytesWritten;
>             bytesWritten=0;
>         }
>         else
>             return;
>     }
> 
>     return;
> }
> 
> 
533,534c584,585
< static char* arenaName = 0;
< static usptr_t* arena = 0;
---
> static char* arenaName = NULL;
> static usptr_t* arena = NULL;
559a611,612
>     
>     arena = NULL;
588,589c641,643
<     if (mtxHandle != NULL) {
<         usfreesema (mtxHandle, arena);
---
>     if ((mtxHandle != NULL) && (arena != NULL)) {
> 
>         usfreesema ((usema_t *)mtxHandle, arena);









-----
We are lagging too far behind
In our desire to race ahead of ourselves
And everybody else in this phantom race.
Information kills the mind; Internet is the new Boob-Tube

[EMAIL PROTECTED]       http://sir.woody.hackswell.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to