Ticket #22287: macsvn.diff
File macsvn.diff, 27.5 KB (added by wyldfire@…, 15 years ago) |
---|
-
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 382 382 ;; 383 383 esac 384 384 fi ;; 385 macosx) 386 bitstobuildDefines=" $bitstobuildDefines -m64 " 387 bitstobuildLink=" -m64 " ;; 385 388 aix) 386 389 if test $cppcompiler; then 387 390 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 1070 1070 SO_DEPDOM =${LIBDEPDOM}.${SO_TARGET_VERSION}${SHLIBSUFFIX} 1071 1071 REAL_DEPDOM=${LIBDEPDOM}.${SO_TARGET_VERSION}.${SO_TARGET_VERSION_MAJOR}${SHLIBSUFFIX} 1072 1072 1073 RESLIB_LINK_NAME=${RESLIBNAME}${SHLIBSUFFIX} 1074 RESLIB_SO_NAME =${RESLIBNAME}${SO_TARGET_VERSION}${SHLIBSUFFIX} 1075 RESLIB_REAL_NAME=${RESLIBNAME}${VER}${SHLIBSUFFIX} 1073 1076 endif 1074 1077 ifeq (${PLATFORM}, QNX) 1075 1078 # -
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 471 471 ;; 472 472 esac 473 473 fi ;; 474 macosx) 475 bitstobuildDefines=" $bitstobuildDefines -m64 " 476 bitstobuildLink=" -m64 " ;; 474 477 aix) 475 478 if test $cppcompiler; then 476 479 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 45 45 unsigned int 46 46 XMLMacCarbonFile::currPos() 47 47 { 48 #if defined(XML_BITSTOBUILD_64) 49 return 0; 50 #else 48 51 OSErr err = noErr; 49 52 unsigned int pos = 0; 50 53 … … 70 73 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetCurPos); 71 74 72 75 return pos; 76 #endif 73 77 } 74 78 75 79 76 80 void 77 81 XMLMacCarbonFile::close() 78 82 { 83 #ifndef XML_BITSTOBUILD_64 79 84 OSErr err = noErr; 80 85 if (!mFileValid) 81 86 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile); … … 89 94 90 95 if (err != noErr) 91 96 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotCloseFile); 97 #endif 92 98 } 93 99 94 100 95 101 unsigned int 96 102 XMLMacCarbonFile::size() 97 103 { 104 #if defined(XML_BITSTOBUILD_64) 105 return 0; 106 #else 98 107 OSErr err = noErr; 99 108 unsigned int len = 0; 100 109 … … 120 129 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotGetSize); 121 130 122 131 return len; 132 #endif 123 133 } 124 134 125 135 126 136 bool 127 137 XMLMacCarbonFile::openWithPermission(const XMLCh* const fileName, int macPermission) 128 138 { 139 #if defined(XML_BITSTOBUILD_64) 140 return false; 141 #else 129 142 OSErr err = noErr; 130 143 131 144 if (mFileValid) … … 159 172 160 173 mFileValid = true; 161 174 return mFileValid; 175 #endif 162 176 } 163 177 164 178 165 179 void 166 180 XMLMacCarbonFile::create(const XMLCh* const filePath) 167 181 { 182 #ifndef XML_BITSTOBUILD_64 168 183 OSErr err = noErr; 169 184 170 185 // Split path into directory and filename components … … 255 270 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotReadFromFile); 256 271 //ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile); 257 272 } 273 #endif 258 274 } 259 275 260 276 261 277 bool 262 278 XMLMacCarbonFile::open(const XMLCh* const path, bool toWrite) 263 279 { 280 #if defined(XML_BITSTOBUILD_64) 281 return false; 282 #else 264 283 bool success = false; 265 284 266 285 if (toWrite) … … 274 293 } 275 294 276 295 return success; 296 #endif 277 297 } 278 298 279 299 280 300 bool 281 301 XMLMacCarbonFile::open(const char* fileName, bool toWrite) 282 302 { 303 #if defined(XML_BITSTOBUILD_64) 304 return false; 305 #else 283 306 // Transcode the input filename from UTF8 into UTF16 284 307 UniChar uniBuf[kMaxMacStaticPathChars]; 285 308 std::size_t pathLen = TranscodeUTF8ToUniChars(fileName, uniBuf, kMaxMacStaticPathChars-1); … … 287 310 288 311 // Call through to the unicode open routine 289 312 return open(uniBuf, toWrite); 313 #endif 290 314 } 291 315 292 316 293 317 unsigned int 294 318 XMLMacCarbonFile::read(const unsigned int toRead, XMLByte* const toFill) 295 319 { 320 #if defined(XML_BITSTOBUILD_64) 321 return 0; 322 #else 296 323 unsigned int bytesRead = 0; 297 324 OSErr err = noErr; 298 325 … … 316 343 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotReadFromFile); 317 344 318 345 return bytesRead; 346 #endif 319 347 } 320 348 321 349 322 350 void 323 351 XMLMacCarbonFile::write(const long byteCount, const XMLByte* const buffer) 324 352 { 353 #ifndef XML_BITSTOBUILD_64 325 354 long bytesWritten = 0; 326 355 OSErr err = noErr; 327 356 … … 350 379 { 351 380 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile); 352 381 } 382 #endif 353 383 } 354 384 355 385 356 386 void 357 387 XMLMacCarbonFile::reset() 358 388 { 389 #ifndef XML_BITSTOBUILD_64 359 390 OSErr err = noErr; 360 391 361 392 if (!mFileValid) … … 368 399 369 400 if (err != noErr) 370 401 ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotResetFile); 402 #endif 371 403 } 372 404 373 405 374 406 XMLMacCarbonFile::~XMLMacCarbonFile() 375 407 { 408 #ifndef XML_BITSTOBUILD_64 376 409 if (mFileValid) 377 410 close(); 411 #endif 378 412 } 379 413 380 414 XERCES_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 31 31 #include <algorithm> 32 32 #include <unistd.h> 33 33 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 34 41 #if defined(__APPLE__) 35 42 // Include from Frameworks Headers under ProjectBuilder 36 43 #include <Carbon/Carbon.h> … … 60 67 #include <xercesc/util/PanicHandler.hpp> 61 68 #include <xercesc/util/OutOfMemoryException.hpp> 62 69 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)) 64 73 #include <xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.hpp> 65 74 #endif 66 75 … … 156 165 bool gUseGETCWD = false; 157 166 158 167 168 #if defined(XML_BITSTOBUILD_64) 169 static XMLMutex* atomicOpsMutex = 0; 170 #endif 159 171 // --------------------------------------------------------------------------- 160 172 // XMLPlatformUtils: The panic method 161 173 // --------------------------------------------------------------------------- … … 176 188 XMLPlatformUtils::curFilePos(const FileHandle theFile 177 189 , MemoryManager* const manager) 178 190 { 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 179 199 return reinterpret_cast<XMLMacAbstractFile*>(theFile)->currPos(); 200 #endif 180 201 } 181 202 182 203 void 183 204 XMLPlatformUtils::closeFile(const FileHandle theFile 184 205 , MemoryManager* const manager) 185 206 { 207 #if defined(XML_BITSTOBUILD_64) 208 if (fclose((FILE*)theFile)) 209 ThrowXMLwithMemMgr(XMLPlatformUtilsException, 210 XMLExcepts::File_CouldNotCloseFile, manager); 211 #else 186 212 reinterpret_cast<XMLMacAbstractFile*>(theFile)->close(); 187 213 delete reinterpret_cast<XMLMacAbstractFile*>(theFile); 214 #endif 188 215 } 189 216 190 217 unsigned int 191 218 XMLPlatformUtils::fileSize(const FileHandle theFile 192 219 , MemoryManager* const manager) 193 220 { 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 194 246 return reinterpret_cast<XMLMacAbstractFile*>(theFile)->size(); 247 #endif 195 248 } 196 249 197 250 … … 199 252 XMLPlatformUtils::openFile(const char* const fileName 200 253 , MemoryManager* const manager) 201 254 { 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 202 262 // Check to make sure the file system is in a state where we can use it 203 263 if (!gFileSystemCompatible) 204 264 ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager); … … 206 266 Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager)); 207 267 208 268 return (file->open(fileName, false)) ? file.release() : NULL; 269 #endif 209 270 } 210 271 211 272 212 273 FileHandle 213 274 XMLPlatformUtils::openFile(const XMLCh* const fileName, MemoryManager* const manager) 214 275 { 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 215 285 // Check to make sure the file system is in a state where we can use it 216 286 if (!gFileSystemCompatible) 217 287 ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager); … … 219 289 Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager)); 220 290 221 291 return (file->open(fileName, false)) ? file.release() : NULL; 292 #endif 222 293 } 223 294 224 295 … … 226 297 XMLPlatformUtils::openFileToWrite(const char* const fileName 227 298 , MemoryManager* const manager) 228 299 { 300 #if defined(XML_BITSTOBUILD_64) 301 return fopen( fileName , "wb" ); 302 #else 229 303 // Check to make sure the file system is in a state where we can use it 230 304 if (!gFileSystemCompatible) 231 305 ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager); … … 233 307 Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager)); 234 308 235 309 return (file->open(fileName, true)) ? file.release() : NULL; 310 #endif 236 311 } 237 312 238 313 … … 240 315 XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName 241 316 , MemoryManager* const manager) 242 317 { 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 243 323 // Check to make sure the file system is in a state where we can use it 244 324 if (!gFileSystemCompatible) 245 325 ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, fileName, manager); … … 247 327 Janitor<XMLMacAbstractFile> file(XMLMakeMacFile(manager)); 248 328 249 329 return (file->open(fileName, true)) ? file.release() : NULL; 330 #endif 250 331 } 251 332 252 333 253 334 FileHandle 254 335 XMLPlatformUtils::openStdInHandle(MemoryManager* const manager) 255 336 { 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 256 351 XMLCh stdinStr[] = {chLatin_s, chLatin_t, chLatin_d, chLatin_i, chLatin_n, chNull}; 257 352 ThrowXMLwithMemMgr1(XMLPlatformUtilsException, XMLExcepts::File_CouldNotOpenFile, stdinStr, manager); 258 353 return NULL; 354 #endif 259 355 } 260 356 261 357 … … 265 361 , XMLByte* const toFill 266 362 , MemoryManager* const manager) 267 363 { 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 268 375 return reinterpret_cast<XMLMacAbstractFile*>(theFile)->read(toRead, toFill); 376 #endif 269 377 } 270 378 271 379 272 380 void 273 381 XMLPlatformUtils::writeBufferToFile( const FileHandle theFile 274 , constlong toWrite382 , long toWrite 275 383 , const XMLByte* const toFlush 276 384 , MemoryManager* const manager) 277 385 { 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 278 416 return reinterpret_cast<XMLMacAbstractFile*>(theFile)->write(toWrite, toFlush); 417 #endif 279 418 } 280 419 281 420 … … 283 422 XMLPlatformUtils::resetFile(FileHandle theFile 284 423 , MemoryManager* const manager) 285 424 { 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 286 431 reinterpret_cast<XMLMacAbstractFile*>(theFile)->reset(); 432 #endif 287 433 } 288 434 289 435 … … 294 440 XMLPlatformUtils::getFullPath(const XMLCh* const srcPath, 295 441 MemoryManager* const manager) 296 442 { 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 297 461 XMLCh* path = NULL; 298 462 299 463 if (gHasHFSPlusAPIs) … … 314 478 } 315 479 316 480 return path; 481 #endif 317 482 } 318 483 319 484 … … 327 492 328 493 XMLCh* XMLPlatformUtils::getCurrentDirectory(MemoryManager* const manager) 329 494 { 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 330 505 // Get a newly allocated path to the current directory 331 506 FSSpec spec; 332 507 … … 344 519 XMLExcepts::File_CouldNotGetBasePathName, manager); 345 520 346 521 return path; 522 #endif 347 523 } 348 524 349 525 … … 360 536 unsigned long 361 537 XMLPlatformUtils::getCurrentMillis() 362 538 { 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 363 544 if ((void*)kUnresolvedCFragSymbolAddress != UpTime) 364 545 { 365 546 // Use Driver services routines, now in Carbon, … … 369 550 } 370 551 else 371 552 return TickCount() * 100 / 6; 553 #endif 372 554 } 373 555 374 556 … … 462 644 // Replace *toFill with newValue iff *toFill == toCompare, 463 645 // returning previous value of *toFill 464 646 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 465 656 Boolean success = CompareAndSwap( 466 657 reinterpret_cast<UInt32>(toCompare), 467 658 reinterpret_cast<UInt32>(newValue), 468 659 reinterpret_cast<UInt32*>(toFill)); 469 470 660 return (success) ? const_cast<void*>(toCompare) : *toFill; 661 #endif 471 662 } 472 663 473 664 … … 482 673 int 483 674 XMLPlatformUtils::atomicIncrement(int &location) 484 675 { 676 #if defined(XML_BITSTOBUILD_64) 677 XMLMutexLock lockMutex(atomicOpsMutex); 678 return ++location; 679 #else 485 680 return IncrementAtomic(reinterpret_cast<long*>(&location)) + 1; 681 #endif 486 682 } 487 683 488 684 489 685 int 490 686 XMLPlatformUtils::atomicDecrement(int &location) 491 687 { 688 #if defined(XML_BITSTOBUILD_64) 689 XMLMutexLock lockMutex(atomicOpsMutex); 690 return --location; 691 #else 492 692 return DecrementAtomic(reinterpret_cast<long*>(&location)) - 1; 693 #endif 493 694 } 494 695 495 696 … … 508 709 // Detect available functions 509 710 510 711 // 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 511 718 gMacOSXOrBetter = noErr == Gestalt(gestaltSystemVersion, &value) 512 719 && value >= 0x00001000 513 720 ; 514 515 721 // Look for file system services 516 722 if (noErr == Gestalt(gestaltFSAttr, &value)) 517 723 { … … 551 757 552 758 // Look for MP 553 759 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 554 770 } 555 771 556 772 … … 560 776 void 561 777 XMLPlatformUtils::platformTerm() 562 778 { 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 563 786 } 564 787 565 788 … … 613 836 XMLMsgLoader* retVal; 614 837 try 615 838 { 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)) 617 842 retVal = new (fgMemoryManager) InMemMsgLoader(msgDomain); 618 843 #else 619 844 #error You must provide a message loader … … 766 991 bool 767 992 XMLParsePathToFSRef(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager) 768 993 { 994 #if defined(XML_BITSTOBUILD_64) 995 return false; 996 #else 769 997 bool result; 770 998 771 999 // If FSPathMakeRef is available, we use it to parse the … … 789 1017 result = XMLParsePathToFSRef_Classic(pathName, ref, manager); 790 1018 791 1019 return result; 1020 #endif 792 1021 } 793 1022 794 1023 795 1024 bool 796 1025 XMLParsePathToFSRef_X(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager) 797 1026 { 1027 #if defined(XML_BITSTOBUILD_64) 1028 return NULL; 1029 #else 798 1030 // Parse Path to FSRef using FSPathMakeRef as available under 799 1031 // Mac OS X and CarbonLib 1.1 and greater. 800 1032 … … 861 1093 862 1094 // Return true on success 863 1095 return (err == noErr); 1096 #endif 864 1097 } 865 1098 866 1099 867 1100 bool 868 1101 XMLParsePathToFSRef_Classic(const XMLCh* const pathName, FSRef& ref, MemoryManager* const manager) 869 1102 { 1103 #if defined(XML_BITSTOBUILD_64) 1104 return NULL; 1105 #else 870 1106 // Parse Path to FSRef by stepping manually through path components. 871 1107 872 1108 // Path's parsed in this way must always begin with a volume name. … … 993 1229 } 994 1230 995 1231 return err == noErr; 1232 #endif 996 1233 } 997 1234 998 1235 … … 1000 1237 XMLParsePathToFSSpec(const XMLCh* const pathName, FSSpec& spec, 1001 1238 MemoryManager* const manager) 1002 1239 { 1240 #if defined(XML_BITSTOBUILD_64) 1241 return NULL; 1242 #else 1003 1243 // Parse Path to an FSSpec 1004 1244 1005 1245 // If we've got HFS+ APIs, do this in terms of refs so that … … 1029 1269 1030 1270 // Return true on success 1031 1271 return result; 1272 #endif 1032 1273 } 1033 1274 1034 1275 … … 1036 1277 XMLParsePathToFSSpec_Classic(const XMLCh* const pathName, FSSpec& spec, 1037 1278 MemoryManager* const manager) 1038 1279 { 1280 #if defined(XML_BITSTOBUILD_64) 1281 return NULL; 1282 #else 1039 1283 // Manually parse the path using FSSpec APIs. 1040 1284 1041 1285 // Transcode the path into ascii … … 1188 1432 } 1189 1433 1190 1434 return err == noErr; 1435 #endif 1191 1436 } 1192 1437 1193 1438 … … 1195 1440 XMLCreateFullPathFromFSRef(const FSRef& startingRef, 1196 1441 MemoryManager* const manager) 1197 1442 { 1443 #if defined(XML_BITSTOBUILD_64) 1444 return NULL; 1445 #else 1198 1446 XMLCh* result = NULL; 1199 1447 1200 1448 // If FSRefMakePath is available, we use it to create the … … 1216 1464 result = XMLCreateFullPathFromFSRef_Classic(startingRef, manager); 1217 1465 1218 1466 return result; 1467 #endif 1219 1468 } 1220 1469 1221 1470 … … 1223 1472 XMLCreateFullPathFromFSRef_X(const FSRef& startingRef, 1224 1473 MemoryManager* const manager) 1225 1474 { 1475 #if defined(XML_BITSTOBUILD_64) 1476 return NULL; 1477 #else 1226 1478 // Create the path using FSRefMakePath as available on Mac OS X 1227 1479 // and under CarbonLib 1.1 and greater. 1228 1480 OSStatus err = noErr; … … 1250 1502 CopyUniCharsToXMLChs(uniBuf, result.get(), pathLen, pathLen); 1251 1503 1252 1504 return result.release(); 1505 #endif 1253 1506 } 1254 1507 1255 1508 … … 1257 1510 XMLCreateFullPathFromFSRef_Classic(const FSRef& startingRef, 1258 1511 MemoryManager* const manager) 1259 1512 { 1513 #if defined(XML_BITSTOBUILD_64) 1514 return NULL; 1515 #else 1260 1516 // Manually create the path using FSRef APIs. 1261 1517 OSStatus err = noErr; 1262 1518 FSCatalogInfo catalogInfo; … … 1336 1592 std::memcpy(final.get() + bufCnt, result.get(), resultLen * sizeof(XMLCh)); 1337 1593 1338 1594 return final.release(); 1595 #endif 1339 1596 } 1340 1597 1341 1598 … … 1343 1600 XMLCreateFullPathFromFSSpec(const FSSpec& startingSpec, 1344 1601 MemoryManager* const manager) 1345 1602 { 1603 #if defined(XML_BITSTOBUILD_64) 1604 return NULL; 1605 #else 1346 1606 XMLCh* result = NULL; 1347 1607 1348 1608 // If FSRefs are available, do this operation in terms of refs...this … … 1368 1628 } 1369 1629 1370 1630 return result; 1631 #endif 1371 1632 } 1372 1633 1373 1634 … … 1375 1636 XMLCreateFullPathFromFSSpec_Classic(const FSSpec& startingSpec, 1376 1637 MemoryManager* const manager) 1377 1638 { 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. 1379 1643 OSStatus err = noErr; 1380 1644 FSSpec spec = startingSpec; 1381 1645 … … 1458 1722 1459 1723 // Cleanup and transcode to unicode 1460 1724 return XMLString::transcode(final.get(), manager); 1725 #endif 1461 1726 } 1462 1727 1463 1728 -
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 98 98 : fCollator(NULL) 99 99 { 100 100 // Test for presense of unicode collation functions 101 #if defined(XML_BITSTOBUILD_64) 102 fHasUnicodeCollation = true; 103 #else 101 104 fHasUnicodeCollation = (UCCompareText != (void*)kUnresolvedCFragSymbolAddress); 105 #endif 102 106 103 107 // Create a unicode collator for doing string comparisons 104 108 if (fHasUnicodeCollation) … … 441 445 UnicodeToTextInfo unicodeToTextInfo = NULL; 442 446 443 447 // Map the encoding to a Mac OS Encoding value 444 Str255 pasEncodingName;445 448 char cEncodingName[256]; 446 449 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; 447 457 CopyCStringToPascal(cEncodingName, pasEncodingName); 458 #endif 448 459 449 460 TextEncoding textEncoding = 0; 450 461 OSStatus status = TECGetTextEncodingFromInternetName ( … … 515 526 bool 516 527 MacOSUnicodeConverter::IsMacOSUnicodeConverterSupported(void) 517 528 { 529 #if defined(XML_BITSTOBUILD_64) 530 return true; 531 #else 518 532 return UpgradeScriptInfoToTextEncoding != (void*)kUnresolvedCFragSymbolAddress 519 533 && CreateTextToUnicodeInfoByEncoding != (void*)kUnresolvedCFragSymbolAddress 520 534 ; 535 #endif 521 536 } 522 537 523 538 … … 626 641 if (status == kTECUnmappableElementErr && options == UnRep_Throw) 627 642 { 628 643 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 629 648 XMLString::binToText((unsigned int)&srcData[charsConsumed], tmpBuf, 16, 16); 649 #endif 630 650 ThrowXML2 631 651 ( 632 652 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 381 381 ;; 382 382 esac 383 383 fi ;; 384 macosx) 385 bitstobuildDefines=" $bitstobuildDefines -m64 " 386 bitstobuildLink=" -m64 " ;; 384 387 aix) 385 388 if test $cppcompiler; then 386 389 case $cppcompiler in