Ticket #22287: macsvn.diff

File macsvn.diff, 27.5 KB (added by wyldfire@…, 14 years ago)

Patch taken from Apache issue tracker (https://issues.apache.org/jira/browse/XERCESC-1772?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel)

  • samples/runConfigure

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/samples/runConfigure ./samples/runConfigure
    old new  
    382382                       ;;
    383383                  esac
    384384              fi ;;
     385           macosx)
     386              bitstobuildDefines=" $bitstobuildDefines -m64 "
     387              bitstobuildLink=" -m64 " ;;             
    385388           aix)
    386389              if test $cppcompiler; then
    387390                  case $cppcompiler in
  • src/xercesc/Makefile.incl

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/src/xercesc/Makefile.incl ./src/xercesc/Makefile.incl
    old new  
    10701070    SO_DEPDOM  =${LIBDEPDOM}.${SO_TARGET_VERSION}${SHLIBSUFFIX}
    10711071    REAL_DEPDOM=${LIBDEPDOM}.${SO_TARGET_VERSION}.${SO_TARGET_VERSION_MAJOR}${SHLIBSUFFIX}
    10721072
     1073    RESLIB_LINK_NAME=${RESLIBNAME}${SHLIBSUFFIX}
     1074    RESLIB_SO_NAME  =${RESLIBNAME}${SO_TARGET_VERSION}${SHLIBSUFFIX}
     1075    RESLIB_REAL_NAME=${RESLIBNAME}${VER}${SHLIBSUFFIX}         
    10731076endif
    10741077ifeq (${PLATFORM}, QNX)
    10751078    #
  • src/xercesc/runConfigure

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/src/xercesc/runConfigure ./src/xercesc/runConfigure
    old new  
    471471                       ;;
    472472                  esac
    473473              fi ;;
     474           macosx)
     475              bitstobuildDefines=" $bitstobuildDefines -m64 "
     476              bitstobuildLink=" -m64 " ;;             
    474477           aix)
    475478              if test $cppcompiler; then
    476479                  case $cppcompiler in
  • src/xercesc/util/Platforms/MacOS/MacCarbonFile.cpp

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/src/xercesc/util/Platforms/MacOS/MacCarbonFile.cpp ./src/xercesc/util/Platforms/MacOS/MacCarbonFile.cpp
    old new  
    4545unsigned int
    4646XMLMacCarbonFile::currPos()
    4747{
     48#if defined(XML_BITSTOBUILD_64)
     49    return 0;
     50#else
    4851    OSErr err = noErr;
    4952    unsigned int pos = 0;
    5053
     
    7073        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetCurPos);
    7174
    7275    return pos;
     76#endif
    7377}
    7478
    7579
    7680void
    7781XMLMacCarbonFile::close()
    7882{
     83#ifndef XML_BITSTOBUILD_64
    7984    OSErr err = noErr;
    8085    if (!mFileValid)
    8186        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile);
     
    8994
    9095    if (err != noErr)
    9196        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile);
     97#endif
    9298}
    9399
    94100
    95101unsigned int
    96102XMLMacCarbonFile::size()
    97103{
     104#if defined(XML_BITSTOBUILD_64)
     105    return 0;
     106#else
    98107    OSErr err = noErr;
    99108    unsigned int len = 0;
    100109
     
    120129        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetSize);
    121130
    122131    return len;
     132#endif
    123133}
    124134
    125135
    126136bool
    127137XMLMacCarbonFile::openWithPermission(const XMLCh* const fileName, int macPermission)
    128138{
     139#if defined(XML_BITSTOBUILD_64)
     140    return false;
     141#else
    129142    OSErr err = noErr;
    130143
    131144    if (mFileValid)
     
    159172
    160173    mFileValid = true;
    161174        return mFileValid;
     175#endif
    162176}
    163177
    164178
    165179void
    166180XMLMacCarbonFile::create(const XMLCh* const filePath)
    167181{
     182#ifndef XML_BITSTOBUILD_64
    168183    OSErr err = noErr;
    169184
    170185    //  Split path into directory and filename components
     
    255270        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotReadFromFile);
    256271        //ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile);
    257272    }
     273#endif
    258274}
    259275
    260276
    261277bool
    262278XMLMacCarbonFile::open(const XMLCh* const path, bool toWrite)
    263279{
     280#if defined(XML_BITSTOBUILD_64)
     281    return false;
     282#else
    264283        bool success = false;
    265284       
    266285        if (toWrite)
     
    274293        }
    275294       
    276295        return success;
     296#endif
    277297}
    278298
    279299
    280300bool
    281301XMLMacCarbonFile::open(const char* fileName, bool toWrite)
    282302{
     303#if defined(XML_BITSTOBUILD_64)
     304    return false;
     305#else
    283306        //      Transcode the input filename from UTF8 into UTF16
    284307        UniChar uniBuf[kMaxMacStaticPathChars];
    285308        std::size_t pathLen = TranscodeUTF8ToUniChars(fileName, uniBuf, kMaxMacStaticPathChars-1);
     
    287310       
    288311        //      Call through to the unicode open routine
    289312        return open(uniBuf, toWrite);
     313#endif
    290314}
    291315
    292316
    293317unsigned int
    294318XMLMacCarbonFile::read(const unsigned int toRead, XMLByte* const toFill)
    295319{
     320#if defined(XML_BITSTOBUILD_64)
     321    return 0;
     322#else
    296323    unsigned int bytesRead = 0;
    297324    OSErr err = noErr;
    298325
     
    316343        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotReadFromFile);
    317344
    318345    return bytesRead;
     346#endif
    319347}
    320348
    321349
    322350void
    323351XMLMacCarbonFile::write(const long byteCount, const XMLByte* const buffer)
    324352{
     353#ifndef XML_BITSTOBUILD_64
    325354    long bytesWritten = 0;
    326355    OSErr err = noErr;
    327356
     
    350379    {
    351380        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile);
    352381    }
     382#endif
    353383}
    354384
    355385
    356386void
    357387XMLMacCarbonFile::reset()
    358388{
     389#ifndef XML_BITSTOBUILD_64
    359390    OSErr err = noErr;
    360391
    361392    if (!mFileValid)
     
    368399
    369400    if (err != noErr)
    370401        ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotResetFile);
     402#endif
    371403}
    372404
    373405
    374406XMLMacCarbonFile::~XMLMacCarbonFile()
    375407{
     408#ifndef XML_BITSTOBUILD_64
    376409    if (mFileValid)
    377410        close();
     411#endif
    378412}
    379413
    380414XERCES_CPP_NAMESPACE_END
  • src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp ./src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp
    old new  
    3131#include <algorithm>
    3232#include <unistd.h>
    3333
     34#if defined(XML_BITSTOBUILD_64)
     35#include <stdio.h>
     36#include <sys/time.h>
     37#include <xercesc/util/Mutexes.hpp>
     38#endif
     39
     40
    3441#if defined(__APPLE__)
    3542    //  Include from Frameworks Headers under ProjectBuilder
    3643    #include <Carbon/Carbon.h>
     
    6067#include <xercesc/util/PanicHandler.hpp>
    6168#include <xercesc/util/OutOfMemoryException.hpp>
    6269
    63 #if (defined(XML_USE_INMEMORY_MSGLOADER) || defined(XML_USE_INMEM_MESSAGELOADER))
     70#if defined(XML_USE_ICU_MESSAGELOADER)
     71    #include <xercesc/util/MsgLoaders/ICU/ICUMsgLoader.hpp>
     72#elif (defined(XML_USE_INMEMORY_MSGLOADER) || defined(XML_USE_INMEM_MESSAGELOADER))
    6473   #include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp>
    6574#endif
    6675
     
    156165bool gUseGETCWD                         = false;
    157166
    158167
     168#if defined(XML_BITSTOBUILD_64)
     169static XMLMutex* atomicOpsMutex = 0;
     170#endif
    159171// ---------------------------------------------------------------------------
    160172//  XMLPlatformUtils: The panic method
    161173// ---------------------------------------------------------------------------
     
    176188XMLPlatformUtils::curFilePos(const FileHandle theFile
    177189                             , MemoryManager* const manager)
    178190{
     191#if defined(XML_BITSTOBUILD_64)
     192    int curPos = ftell( (FILE*)theFile);
     193    if (curPos == -1)
     194        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     195                 XMLExcepts::File_CouldNotGetSize, manager);
     196
     197    return (unsigned int)curPos;
     198#else
    179199        return reinterpret_cast<XMLMacAbstractFile*>(theFile)->currPos();
     200#endif
    180201}
    181202
    182203void
    183204XMLPlatformUtils::closeFile(const FileHandle theFile
    184205                            , MemoryManager* const manager)
    185206{
     207#if defined(XML_BITSTOBUILD_64)
     208    if (fclose((FILE*)theFile))
     209        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     210                 XMLExcepts::File_CouldNotCloseFile, manager);
     211#else
    186212    reinterpret_cast<XMLMacAbstractFile*>(theFile)->close();
    187213        delete reinterpret_cast<XMLMacAbstractFile*>(theFile);
     214#endif
    188215}
    189216
    190217unsigned int
    191218XMLPlatformUtils::fileSize(const FileHandle theFile
    192219                           , MemoryManager* const manager)
    193220{
     221#if defined(XML_BITSTOBUILD_64)
     222    // Get the current position
     223    long  int curPos = ftell((FILE*) theFile);
     224    if (curPos == -1)
     225        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     226                 XMLExcepts::File_CouldNotGetCurPos, manager);
     227
     228    // Seek to the end and save that value for return
     229     if (fseek((FILE*) theFile, 0, SEEK_END))
     230        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     231                 XMLExcepts::File_CouldNotSeekToEnd, manager);
     232
     233    long int retVal = ftell((FILE*)theFile);
     234    if (retVal == -1)
     235        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     236                 XMLExcepts::File_CouldNotSeekToEnd, manager);
     237
     238    // And put the pointer back
     239
     240    if (fseek( (FILE*)theFile, curPos, SEEK_SET) )
     241        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     242                 XMLExcepts::File_CouldNotSeekToPos, manager);
     243
     244    return (unsigned int)retVal;
     245#else
    194246    return reinterpret_cast<XMLMacAbstractFile*>(theFile)->size();
     247#endif
    195248}
    196249
    197250
     
    199252XMLPlatformUtils::openFile(const char* const fileName
    200253                           , MemoryManager* const manager)
    201254{
     255#if defined(XML_BITSTOBUILD_64)
     256    FileHandle retVal = (FILE*)fopen( fileName , "rb" );
     257
     258    if (retVal == NULL)
     259        return 0;
     260    return retVal;
     261#else
    202262    // Check to make sure the file system is in a state where we can use it
    203263    if (!gFileSystemCompatible)
    204264        ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager);
     
    206266    Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager));
    207267   
    208268    return (file->open(fileName, false)) ? file.release() : NULL;
     269#endif
    209270}
    210271
    211272
    212273FileHandle
    213274XMLPlatformUtils::openFile(const XMLCh* const fileName, MemoryManager* const manager)
    214275{
     276#if defined(XML_BITSTOBUILD_64)
     277    const char* tmpFileName = XMLString::transcode(fileName, manager);
     278    ArrayJanitor<char> janText((char*)tmpFileName, manager);
     279    FileHandle retVal = (FILE*)fopen( tmpFileName , "rb" );
     280
     281    if (retVal == NULL)
     282        return 0;
     283    return retVal;
     284#else
    215285    // Check to make sure the file system is in a state where we can use it
    216286    if (!gFileSystemCompatible)
    217287        ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager);
     
    219289    Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager));
    220290
    221291    return (file->open(fileName, false)) ? file.release() : NULL;
     292#endif
    222293}
    223294
    224295
     
    226297XMLPlatformUtils::openFileToWrite(const char* const fileName
    227298                                  , MemoryManager* const manager)
    228299{
     300#if defined(XML_BITSTOBUILD_64)
     301    return fopen( fileName , "wb" );
     302#else
    229303    // Check to make sure the file system is in a state where we can use it
    230304    if (!gFileSystemCompatible)
    231305        ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager);
     
    233307    Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager));
    234308
    235309    return (file->open(fileName, true)) ? file.release() : NULL;
     310#endif
    236311}
    237312
    238313
     
    240315XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName
    241316                                  , MemoryManager* const manager)
    242317{
     318#if defined(XML_BITSTOBUILD_64)
     319    const char* tmpFileName = XMLString::transcode(fileName, manager);
     320    ArrayJanitor<char> janText((char*)tmpFileName, manager);
     321    return fopen( tmpFileName , "wb" );
     322#else
    243323    // Check to make sure the file system is in a state where we can use it
    244324    if (!gFileSystemCompatible)
    245325        ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager);
     
    247327    Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager));
    248328
    249329    return (file->open(fileName, true)) ? file.release() : NULL;
     330#endif
    250331}
    251332
    252333
    253334FileHandle
    254335XMLPlatformUtils::openStdInHandle(MemoryManager* const manager)
    255336{
     337#if defined(XML_BITSTOBUILD_64)
     338    int nfd = dup(0);
     339    FileHandle fh;
     340    if (nfd == -1)
     341            ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     342                    XMLExcepts::File_CouldNotDupHandle, manager);
     343    fh = (FileHandle) fdopen(nfd, "r");
     344    if (fh == 0) {
     345    XMLCh stdinStr[] = {chLatin_s, chLatin_t, chLatin_d, chLatin_i, chLatin_n, chNull};
     346    ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, stdinStr, manager);
     347    return NULL;
     348    }
     349    return fh;
     350#else
    256351    XMLCh stdinStr[] = {chLatin_s, chLatin_t, chLatin_d, chLatin_i, chLatin_n, chNull};
    257352    ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, stdinStr, manager);
    258353    return NULL;
     354#endif
    259355}
    260356
    261357
     
    265361                                 ,        XMLByte* const  toFill
    266362                                 ,  MemoryManager* const  manager)
    267363{
     364#if defined(XML_BITSTOBUILD_64)
     365    size_t noOfItemsRead = fread((void*) toFill, 1, toRead, (FILE*)theFile);
     366
     367    if(ferror((FILE*)theFile))
     368    {
     369        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     370                 XMLExcepts::File_CouldNotReadFromFile, manager);
     371    }
     372
     373    return (unsigned int)noOfItemsRead;
     374#else
    268375    return reinterpret_cast<XMLMacAbstractFile*>(theFile)->read(toRead, toFill);
     376#endif
    269377}
    270378
    271379
    272380void
    273381XMLPlatformUtils::writeBufferToFile(   const   FileHandle   theFile
    274                                     ,  const long                   toWrite
     382                                    ,  long                 toWrite
    275383                                    ,  const XMLByte* const toFlush
    276384                                    ,  MemoryManager* const manager)
    277385{
     386#if defined(XML_BITSTOBUILD_64)
     387    if (!theFile        ||
     388        (toWrite <= 0 ) ||
     389        !toFlush         )
     390        return;
     391
     392    const XMLByte* tmpFlush = (const XMLByte*) toFlush;
     393    size_t bytesWritten = 0;
     394
     395    while (true)
     396    {
     397        bytesWritten=fwrite(tmpFlush, sizeof(XMLByte), toWrite, (FILE*)theFile);
     398
     399        if(ferror((FILE*)theFile))
     400        {
     401            ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile, manager);
     402        }
     403
     404        if (bytesWritten < toWrite) //incomplete write
     405        {
     406            tmpFlush+=bytesWritten;
     407            toWrite-=bytesWritten;
     408            bytesWritten=0;
     409        }
     410        else
     411            return;
     412    }
     413
     414    return;
     415#else
    278416    return reinterpret_cast<XMLMacAbstractFile*>(theFile)->write(toWrite, toFlush);
     417#endif
    279418}
    280419
    281420
     
    283422XMLPlatformUtils::resetFile(FileHandle theFile
    284423                            , MemoryManager* const manager)
    285424{
     425#if defined(XML_BITSTOBUILD_64)
     426    // Seek to the start of the file
     427    if (fseek((FILE*)theFile, 0, SEEK_SET))
     428        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     429                 XMLExcepts::File_CouldNotResetFile, manager);
     430#else
    286431    reinterpret_cast<XMLMacAbstractFile*>(theFile)->reset();
     432#endif
    287433}
    288434
    289435
     
    294440XMLPlatformUtils::getFullPath(const XMLCh* const srcPath,
    295441                              MemoryManager* const manager)
    296442{
     443#if defined(XML_BITSTOBUILD_64)
     444    //
     445    //  NOTE: The path provided has always already been opened successfully,
     446    //  so we know that its not some pathological freaky path. It comes in
     447    //  in native format, and goes out as Unicode always
     448    //
     449    char* newSrc = XMLString::transcode(srcPath, manager);
     450    ArrayJanitor<char> janText(newSrc, manager);
     451
     452    // Use a local buffer that is big enough for the largest legal path
     453    char absPath[PATH_MAX + 1];
     454   
     455    // get the absolute path
     456    if (!realpath(newSrc, absPath))
     457                ThrowXMLwithMemMgr(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetBasePathName, manager);
     458
     459    return XMLString::transcode(absPath, manager);
     460#else
    297461    XMLCh* path = NULL;
    298462
    299463    if (gHasHFSPlusAPIs)
     
    314478    }
    315479
    316480    return path;
     481#endif
    317482}
    318483
    319484
     
    327492
    328493XMLCh* XMLPlatformUtils::getCurrentDirectory(MemoryManager* const manager)
    329494{
     495#if defined(XML_BITSTOBUILD_64)
     496    char dirBuf[PATH_MAX + 2];
     497    char *curDir = getcwd(&dirBuf[0], PATH_MAX + 1);
     498
     499    if (!curDir)
     500        ThrowXMLwithMemMgr(XMLPlatformUtilsException,
     501                 XMLExcepts::File_CouldNotGetBasePathName, manager);
     502
     503    return XMLString::transcode(curDir, manager);
     504#else
    330505        //      Get a newly allocated path to the current directory
    331506        FSSpec spec;
    332507
     
    344519                   XMLExcepts::File_CouldNotGetBasePathName, manager);
    345520                   
    346521        return path;
     522#endif
    347523}
    348524
    349525
     
    360536unsigned long
    361537XMLPlatformUtils::getCurrentMillis()
    362538{
     539#if defined(XML_BITSTOBUILD_64)
     540        struct timeval aTime;
     541        gettimeofday(&aTime, NULL);
     542        return (unsigned long) (aTime.tv_sec * 1000 + aTime.tv_usec / 1000);
     543#else
    363544        if ((void*)kUnresolvedCFragSymbolAddress != UpTime)
    364545        {
    365546                // Use Driver services routines, now in Carbon,
     
    369550        }
    370551        else
    371552                return TickCount() * 100 / 6;
     553#endif
    372554}
    373555
    374556
     
    462644    // Replace *toFill with newValue iff *toFill == toCompare,
    463645    // returning previous value of *toFill
    464646
     647#if defined(XML_BITSTOBUILD_64)
     648    XMLMutexLock lockMutex(atomicOpsMutex);
     649
     650    void *retVal = *toFill;
     651    if (*toFill == toCompare)
     652        *toFill = (void *)newValue;
     653
     654    return retVal;
     655#else
    465656    Boolean success = CompareAndSwap(
    466657        reinterpret_cast<UInt32>(toCompare),
    467658        reinterpret_cast<UInt32>(newValue),
    468659        reinterpret_cast<UInt32*>(toFill));
    469 
    470660    return (success) ? const_cast<void*>(toCompare) : *toFill;
     661#endif
    471662}
    472663
    473664
     
    482673int
    483674XMLPlatformUtils::atomicIncrement(int &location)
    484675{
     676#if defined(XML_BITSTOBUILD_64)
     677    XMLMutexLock lockMutex(atomicOpsMutex);
     678    return ++location;
     679#else
    485680    return IncrementAtomic(reinterpret_cast<long*>(&location)) + 1;
     681#endif
    486682}
    487683
    488684
    489685int
    490686XMLPlatformUtils::atomicDecrement(int &location)
    491687{
     688#if defined(XML_BITSTOBUILD_64)
     689    XMLMutexLock lockMutex(atomicOpsMutex);
     690    return --location;
     691#else
    492692    return DecrementAtomic(reinterpret_cast<long*>(&location)) - 1;
     693#endif
    493694}
    494695
    495696
     
    508709        //      Detect available functions
    509710       
    510711        //  Check whether we're on OS X
     712#if defined(XML_BITSTOBUILD_64)
     713        gMacOSXOrBetter = true;
     714        gUsePosixFiles  = true;
     715        gFileSystemCompatible = true;
     716        gHasMPAPIs      = true;
     717#else
    511718        gMacOSXOrBetter                 = noErr == Gestalt(gestaltSystemVersion, &value)
    512719                                                          && value >= 0x00001000
    513720                                                          ;
    514        
    515721    //  Look for file system services
    516722    if (noErr == Gestalt(gestaltFSAttr, &value))
    517723    {
     
    551757
    552758    //  Look for MP
    553759        gHasMPAPIs                              = MPLibraryIsLoaded();
     760#endif
     761
     762#if defined(XML_BITSTOBUILD_64)
     763    if ( atomicOpsMutex == 0 )
     764    {
     765        atomicOpsMutex = new (fgMemoryManager) XMLMutex(fgMemoryManager);
     766        if (atomicOpsMutex->fHandle == 0)
     767           atomicOpsMutex->fHandle = XMLPlatformUtils::makeMutex(fgMemoryManager);
     768    }
     769#endif
    554770}
    555771
    556772
     
    560776void
    561777XMLPlatformUtils::platformTerm()
    562778{
     779#if defined(XML_BITSTOBUILD_64)
     780    // delete the mutex we created
     781    closeMutex(atomicOpsMutex->fHandle);
     782    atomicOpsMutex->fHandle = 0;
     783    delete atomicOpsMutex;
     784    atomicOpsMutex = 0;
     785#endif
    563786}
    564787
    565788
     
    613836    XMLMsgLoader* retVal;
    614837    try
    615838    {
    616 #if (defined(XML_USE_INMEMORY_MSGLOADER) || defined(XML_USE_INMEM_MESSAGELOADER))
     839#if defined (XML_USE_ICU_MESSAGELOADER)
     840        retVal = new (fgMemoryManager) ICUMsgLoader(msgDomain);
     841#elif (defined(XML_USE_INMEMORY_MSGLOADER) || defined(XML_USE_INMEM_MESSAGELOADER))
    617842        retVal = new (fgMemoryManager) InMemMsgLoader(msgDomain);
    618843#else
    619844        #error You must provide a message loader
     
    766991bool
    767992XMLParsePathToFSRef(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager)
    768993{
     994#if defined(XML_BITSTOBUILD_64)
     995    return false;
     996#else
    769997        bool result;
    770998       
    771999        //      If FSPathMakeRef is available, we use it to parse the
     
    7891017                result = XMLParsePathToFSRef_Classic(pathName, ref, manager);
    7901018               
    7911019        return result;
     1020#endif
    7921021}
    7931022
    7941023
    7951024bool
    7961025XMLParsePathToFSRef_X(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager)
    7971026{
     1027#if defined(XML_BITSTOBUILD_64)
     1028    return NULL;
     1029#else
    7981030        //      Parse Path to FSRef using FSPathMakeRef as available under
    7991031        //      Mac OS X and CarbonLib 1.1 and greater.
    8001032       
     
    8611093               
    8621094        //      Return true on success
    8631095        return (err == noErr);
     1096#endif
    8641097}
    8651098
    8661099
    8671100bool
    8681101XMLParsePathToFSRef_Classic(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager)
    8691102{
     1103#if defined(XML_BITSTOBUILD_64)
     1104    return NULL;
     1105#else
    8701106        //      Parse Path to FSRef by stepping manually through path components.
    8711107       
    8721108        //      Path's parsed in this way must always begin with a volume name.
     
    9931229    }
    9941230
    9951231    return err == noErr;
     1232#endif
    9961233}
    9971234
    9981235
     
    10001237XMLParsePathToFSSpec(const XMLCh* const pathName, FSSpec& spec,
    10011238                            MemoryManager* const manager)
    10021239{
     1240#if defined(XML_BITSTOBUILD_64)
     1241    return NULL;
     1242#else
    10031243        //      Parse Path to an FSSpec
    10041244
    10051245        //      If we've got HFS+ APIs, do this in terms of refs so that
     
    10291269               
    10301270        //      Return true on success
    10311271        return result;
     1272#endif
    10321273}
    10331274
    10341275
     
    10361277XMLParsePathToFSSpec_Classic(const XMLCh* const pathName, FSSpec& spec,
    10371278                            MemoryManager* const manager)
    10381279{
     1280#if defined(XML_BITSTOBUILD_64)
     1281    return NULL;
     1282#else
    10391283        //      Manually parse the path using FSSpec APIs.
    10401284       
    10411285    //  Transcode the path into ascii
     
    11881432    }
    11891433
    11901434    return err == noErr;
     1435#endif
    11911436}
    11921437
    11931438
     
    11951440XMLCreateFullPathFromFSRef(const FSRef& startingRef,
    11961441                            MemoryManager* const manager)
    11971442{
     1443#if defined(XML_BITSTOBUILD_64)
     1444    return NULL;
     1445#else
    11981446        XMLCh* result = NULL;
    11991447       
    12001448        //      If FSRefMakePath is available, we use it to create the
     
    12161464                result = XMLCreateFullPathFromFSRef_Classic(startingRef, manager);
    12171465               
    12181466        return result;
     1467#endif
    12191468}
    12201469
    12211470
     
    12231472XMLCreateFullPathFromFSRef_X(const FSRef& startingRef,
    12241473                            MemoryManager* const manager)
    12251474{
     1475#if defined(XML_BITSTOBUILD_64)
     1476    return NULL;
     1477#else
    12261478        //      Create the path using FSRefMakePath as available on Mac OS X
    12271479        //      and under CarbonLib 1.1 and greater.
    12281480        OSStatus err = noErr;
     
    12501502                CopyUniCharsToXMLChs(uniBuf, result.get(), pathLen, pathLen);
    12511503               
    12521504        return result.release();
     1505#endif
    12531506}
    12541507
    12551508
     
    12571510XMLCreateFullPathFromFSRef_Classic(const FSRef& startingRef,
    12581511                            MemoryManager* const manager)
    12591512{
     1513#if defined(XML_BITSTOBUILD_64)
     1514    return NULL;
     1515#else
    12601516        //      Manually create the path using FSRef APIs.
    12611517    OSStatus err = noErr;
    12621518    FSCatalogInfo catalogInfo;
     
    13361592                std::memcpy(final.get() + bufCnt, result.get(), resultLen * sizeof(XMLCh));
    13371593       
    13381594    return final.release();
     1595#endif
    13391596}
    13401597
    13411598
     
    13431600XMLCreateFullPathFromFSSpec(const FSSpec& startingSpec,
    13441601                            MemoryManager* const manager)
    13451602{
     1603#if defined(XML_BITSTOBUILD_64)
     1604    return NULL;
     1605#else
    13461606        XMLCh* result = NULL;
    13471607       
    13481608        //      If FSRefs are available, do this operation in terms of refs...this
     
    13681628        }
    13691629               
    13701630        return result;
     1631#endif
    13711632}
    13721633
    13731634
     
    13751636XMLCreateFullPathFromFSSpec_Classic(const FSSpec& startingSpec,
    13761637                                    MemoryManager* const manager)
    13771638{
    1378         //      Manually create the path using FSSpec APIs.
     1639#if defined(XML_BITSTOBUILD_64)
     1640    return NULL;
     1641#else
     1642    //  Manually create the path using FSSpec APIs.
    13791643    OSStatus err = noErr;
    13801644    FSSpec spec = startingSpec;
    13811645
     
    14581722
    14591723    // Cleanup and transcode to unicode
    14601724    return XMLString::transcode(final.get(), manager);
     1725#endif
    14611726}
    14621727
    14631728
  • src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp ./src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
    old new  
    9898  : fCollator(NULL)
    9999{
    100100        //      Test for presense of unicode collation functions
     101#if defined(XML_BITSTOBUILD_64)
     102        fHasUnicodeCollation = true;
     103#else
    101104        fHasUnicodeCollation = (UCCompareText != (void*)kUnresolvedCFragSymbolAddress);
     105#endif
    102106   
    103107    //  Create a unicode collator for doing string comparisons
    104108    if (fHasUnicodeCollation)
     
    441445        UnicodeToTextInfo unicodeToTextInfo = NULL;
    442446
    443447        //      Map the encoding to a Mac OS Encoding value
    444         Str255 pasEncodingName;
    445448        char cEncodingName[256];
    446449        ConvertWideToNarrow(encodingName, cEncodingName, sizeof(cEncodingName));
     450#if defined(XML_BITSTOBUILD_64)
     451        CFStringRef temp;
     452        temp = CFStringCreateWithCString(NULL, cEncodingName, kCFStringEncodingUTF16);
     453        const unsigned char* pasEncodingName = CFStringGetPascalStringPtr (temp, kCFStringEncodingASCII);
     454
     455#else
     456        Str255 pasEncodingName;
    447457        CopyCStringToPascal(cEncodingName, pasEncodingName);
     458#endif
    448459       
    449460        TextEncoding textEncoding = 0;
    450461        OSStatus status = TECGetTextEncodingFromInternetName (
     
    515526bool
    516527MacOSUnicodeConverter::IsMacOSUnicodeConverterSupported(void)
    517528{
     529#if defined(XML_BITSTOBUILD_64)
     530    return true;
     531#else
    518532    return UpgradeScriptInfoToTextEncoding != (void*)kUnresolvedCFragSymbolAddress
    519533        && CreateTextToUnicodeInfoByEncoding != (void*)kUnresolvedCFragSymbolAddress
    520534        ;
     535#endif
    521536}
    522537
    523538
     
    626641        if (status == kTECUnmappableElementErr && options == UnRep_Throw)
    627642        {
    628643                XMLCh tmpBuf[17];
     644#if defined(XML_BITSTOBUILD_64)
     645            unsigned int tmpValue = (unsigned int)srcData[charsConsumed];
     646            XMLString::binToText(tmpValue, tmpBuf, 16, 16);
     647#else
    629648            XMLString::binToText((unsigned int)&srcData[charsConsumed], tmpBuf, 16, 16);
     649#endif
    630650            ThrowXML2
    631651            (
    632652                TranscodingException
  • tests/runConfigure

    diff -r -u /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_textproc_xercesc/work/xerces-c-src_2_8_0/tests/runConfigure ./tests/runConfigure
    old new  
    381381                       ;;
    382382                  esac
    383383              fi ;;
     384           macosx)
     385              bitstobuildDefines=" $bitstobuildDefines -m64 "
     386              bitstobuildLink=" -m64 " ;;             
    384387           aix)
    385388              if test $cppcompiler; then
    386389                  case $cppcompiler in