You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by jb...@apache.org on 2002/07/12 18:48:50 UTC
cvs commit: xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter MacOSUnicodeConverter.cpp MacOSUnicodeConverter.hpp
jberry 2002/07/12 09:48:50
Modified: c/src/xercesc/util AutoSense.hpp XercesDefs.hpp
c/src/xercesc/util/Compilers CodeWarriorDefs.cpp
CodeWarriorDefs.hpp
c/src/xercesc/util/NetAccessors/MacOSURLAccess
URLAccessBinInputStream.hpp
c/src/xercesc/util/NetAccessors/MacOSURLAccessCF
URLAccessCFBinInputStream.hpp
c/src/xercesc/util/Platforms/MacOS MacOSPlatformUtils.cpp
MacOSPlatformUtils.hpp
c/src/xercesc/util/Transcoders/MacOSUnicodeConverter
MacOSUnicodeConverter.cpp MacOSUnicodeConverter.hpp
Log:
Remove reliance on XML_MACOSX. XML_MACOS is used solely. Where qualification
by compiler is required, look for the compiler explicitly such as with
XML_METROWERKS or __APPLE__ (for the Apple GCC compiler).
Add a few tweaks for compatibility with GCC3.1.
This change may address Bug 10649.
Revision Changes Path
1.4 +4 -3 xml-xerces/c/src/xercesc/util/AutoSense.hpp
Index: AutoSense.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/AutoSense.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AutoSense.hpp 4 Mar 2002 20:31:14 -0000 1.3
+++ AutoSense.hpp 12 Jul 2002 16:48:49 -0000 1.4
@@ -56,6 +56,15 @@
/*
* $Log$
+ * Revision 1.4 2002/07/12 16:48:49 jberry
+ * Remove reliance on XML_MACOSX. XML_MACOS is used solely. Where qualification
+ * by compiler is required, look for the compiler explicitly such as with
+ * XML_METROWERKS or __APPLE__ (for the Apple GCC compiler).
+ *
+ * Add a few tweaks for compatibility with GCC3.1.
+ *
+ * This change may address Bug 10649.
+ *
* Revision 1.3 2002/03/04 20:31:14 tng
* [Bug 2868] AIX 4.3.3 mutex/atomic-operation changes for build.
*
@@ -213,10 +222,8 @@
#elif defined(__MSDXML__)
#define XML_DOS
-#elif defined(macintosh)
+#elif defined(macintosh) || (defined(__APPLE__) && defined(__MACH__))
#define XML_MACOS
-#elif defined(__APPLE__) && defined(__MACH__)
- #define XML_MACOSX
#elif defined(__alpha) && defined(__osf__)
#define XML_TRU64
#else
1.7 +4 -1 xml-xerces/c/src/xercesc/util/XercesDefs.hpp
Index: XercesDefs.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/XercesDefs.hpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XercesDefs.hpp 10 Jul 2002 12:56:45 -0000 1.6
+++ XercesDefs.hpp 12 Jul 2002 16:48:49 -0000 1.7
@@ -56,6 +56,15 @@
/*
* $Log$
+ * Revision 1.7 2002/07/12 16:48:49 jberry
+ * Remove reliance on XML_MACOSX. XML_MACOS is used solely. Where qualification
+ * by compiler is required, look for the compiler explicitly such as with
+ * XML_METROWERKS or __APPLE__ (for the Apple GCC compiler).
+ *
+ * Add a few tweaks for compatibility with GCC3.1.
+ *
+ * This change may address Bug 10649.
+ *
* Revision 1.6 2002/07/10 12:56:45 tng
* [Bug 9154] Requesting Xerces Version Macro.
*
@@ -258,7 +267,7 @@
#include <xercesc/util/Platforms/OS2/OS2Defs.hpp>
#endif
-#if defined(XML_MACOS) || defined(XML_MACOSX)
+#if defined(XML_MACOS)
#include <xercesc/util/Platforms/MacOS/MacOSDefs.hpp>
#endif
1.2 +4 -1 xml-xerces/c/src/xercesc/util/Compilers/CodeWarriorDefs.cpp
Index: CodeWarriorDefs.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Compilers/CodeWarriorDefs.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CodeWarriorDefs.cpp 1 Feb 2002 22:22:18 -0000 1.1
+++ CodeWarriorDefs.cpp 12 Jul 2002 16:48:49 -0000 1.2
@@ -62,7 +62,9 @@
#include <ctype.h>
// These functions are needed because MacOS doesn't define them
+// (these routines are defined in CW 8 by extras.h)
+#if 0
// Compare lexigraphically two strings
int stricmp(const char *s1, const char *s2)
{
@@ -92,4 +94,5 @@
}
return 0;
}
+#endif
1.6 +5 -1 xml-xerces/c/src/xercesc/util/Compilers/CodeWarriorDefs.hpp
Index: CodeWarriorDefs.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Compilers/CodeWarriorDefs.hpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CodeWarriorDefs.hpp 24 Jun 2002 21:55:44 -0000 1.5
+++ CodeWarriorDefs.hpp 12 Jul 2002 16:48:49 -0000 1.6
@@ -66,6 +66,7 @@
// ---------------------------------------------------------------------------
//#include <sys/types.h> // for size_t and ssize_t
//#include <limits.h> // for MAX of size_t and ssize_t
+//#include <extras.h>
// ---------------------------------------------------------------------------
@@ -136,9 +137,12 @@
// ---------------------------------------------------------------------------
// Provide some common string ops that are different/notavail for CodeWarrior.
+// (these routines are defined in CW 8 by extras.h)
// ---------------------------------------------------------------------------
+#if 0
int stricmp(const char* const str1, const char* const str2);
int strnicmp(const char* const str1, const char* const str2, const unsigned int count);
+#endif
// ---------------------------------------------------------------------------
// The name of the DLL that is built by the Codewarrior version of the
1.2 +2 -2 xml-xerces/c/src/xercesc/util/NetAccessors/MacOSURLAccess/URLAccessBinInputStream.hpp
Index: URLAccessBinInputStream.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/NetAccessors/MacOSURLAccess/URLAccessBinInputStream.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URLAccessBinInputStream.hpp 1 Feb 2002 22:22:23 -0000 1.1
+++ URLAccessBinInputStream.hpp 12 Jul 2002 16:48:49 -0000 1.2
@@ -69,7 +69,7 @@
#include <xercesc/util/XMLExceptMsgs.hpp>
#include <xercesc/util/BinInputStream.hpp>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Framework includes from ProjectBuilder
#include <Carbon/Carbon.h>
#else
1.2 +2 -2 xml-xerces/c/src/xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp
Index: URLAccessCFBinInputStream.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URLAccessCFBinInputStream.hpp 18 Feb 2002 05:50:42 -0000 1.1
+++ URLAccessCFBinInputStream.hpp 12 Jul 2002 16:48:49 -0000 1.2
@@ -69,7 +69,7 @@
#include <xercesc/util/XMLExceptMsgs.hpp>
#include <xercesc/util/BinInputStream.hpp>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Framework includes from ProjectBuilder
#include <CoreServices/CoreServices.h>
#else
1.6 +10 -5 xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp
Index: MacOSPlatformUtils.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MacOSPlatformUtils.cpp 25 Jun 2002 00:32:40 -0000 1.5
+++ MacOSPlatformUtils.cpp 12 Jul 2002 16:48:49 -0000 1.6
@@ -99,7 +99,7 @@
#include <memory>
#include <algorithm>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Include from Frameworks Headers under ProjectBuilder
#include <Carbon/Carbon.h>
#else
@@ -530,9 +530,6 @@
else
reasonStr = "Unknown error source";
- char text[256];
- std::snprintf(text, sizeof(text), "Xerces Panic Error: %s", reasonStr);
-
//
// The default handling of panics is not very friendly.
// To replace it with something more friendly, you'll need to:
@@ -543,6 +540,14 @@
#if defined(XML_USE_CUSTOM_PANIC_PROC)
XMLCustomPanicProc(reason, reasonStr);
#else
+ char text[256];
+
+ #if defined(XML_METROWERKS) || defined(_GLIBCPP_USE_C99)
+ std::snprintf(text, sizeof(text), "Xerces Panic Error: %s", reasonStr);
+ #else
+ std::sprintf(text, "Xerces Panic Error: %s", reasonStr);
+ #endif
+
Str255 pasText;
CopyCStringToPascal(text, pasText);
DebugStr(pasText);
1.3 +2 -2 xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp
Index: MacOSPlatformUtils.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MacOSPlatformUtils.hpp 23 Jun 2002 22:26:14 -0000 1.2
+++ MacOSPlatformUtils.hpp 12 Jul 2002 16:48:50 -0000 1.3
@@ -63,7 +63,7 @@
#include <xercesc/util/XercesDefs.hpp>
#include <cstdlib>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Framework includes from ProjectBuilder
#include <CoreServices/CoreServices.h>
#else
1.4 +10 -12 xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
Index: MacOSUnicodeConverter.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MacOSUnicodeConverter.cpp 19 May 2002 22:57:56 -0000 1.3
+++ MacOSUnicodeConverter.cpp 12 Jul 2002 16:48:50 -0000 1.4
@@ -71,9 +71,9 @@
#include <xercesc/util/Janitor.hpp>
#include <xercesc/util/Platforms/MacOS/MacOSPlatformUtils.hpp>
-#if defined(XML_METROWERKS)
+#if defined(XML_METROWERKS) // || (__GNUC__ >= 3)
// Only used under metrowerks.
- // In MacOS X Public Beta, the system wchar.h header is missing, which causes this to fail.
+ // In ProjectBuilder, the system wchar.h header is missing, which causes this to fail.
#include <cwctype>
#endif
@@ -81,7 +81,7 @@
#include <cstddef>
#include <cstring>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Framework includes from ProjectBuilder
#include <CoreServices/CoreServices.h>
#else
@@ -392,11 +392,11 @@
bool MacOSUnicodeConverter::isSpace(const XMLCh toCheck) const
{
-#if defined(XML_METROWERKS)
+#if defined(XML_METROWERKS) // || (__GNUC__ >= 3)
// Use this if there's a reasonable c library available.
// ProjectBuilder currently has no support for iswspace ;(
return (std::iswspace(toCheck) != 0);
-#elif defined(XML_MACOSX) || true
+#elif defined(__APPLE__) || true
// This looks fairly good, assuming we're on an ascii compiler.
// We'll use this under ProjectBuilder for now.
return (toCheck == L' ');
@@ -464,14 +464,13 @@
void MacOSUnicodeConverter::upperCase(XMLCh* const toUpperCase) const
{
- // ��� TODO: Support CFString for this conversion
-#if defined(XML_METROWERKS)
+#if defined(XML_METROWERKS) // || (__GNUC__ >= 3)
// Use this if there's a reasonable c library available.
// Metrowerks does this reasonably
wchar_t c;
for (XMLCh* p = (XMLCh*)toUpperCase; ((c = *p) != 0); )
*p++ = std::towupper(c);
-#elif defined(XML_MACOSX) || true
+#elif defined(__APPLE__) || true
// This might work, assuming we're on an ascii compiler.
// We'll use this under ProjectBuilder for now.
// Note that this only handles the ascii portion of the
@@ -491,14 +490,13 @@
void MacOSUnicodeConverter::lowerCase(XMLCh* const toLowerCase) const
{
- // ��� TODO: Support CFString for this conversion
-#if defined(XML_METROWERKS)
+#if defined(XML_METROWERKS) // || (__GNUC__ >= 3)
// Use this if there's a reasonable c library available.
// Metrowerks does this reasonably
wchar_t c;
for (XMLCh* p = (XMLCh*)toLowerCase; ((c = *p) != 0); )
*p++ = std::towlower(c);
-#elif defined(XML_MACOSX) || true
+#elif defined(__APPLE__) || true
// This might work, assuming we're on an ascii compiler.
// We'll use this under ProjectBuilder for now.
// Note that this only handles the ascii portion of the
1.3 +2 -2 xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
Index: MacOSUnicodeConverter.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MacOSUnicodeConverter.hpp 9 Apr 2002 15:44:00 -0000 1.2
+++ MacOSUnicodeConverter.hpp 12 Jul 2002 16:48:50 -0000 1.3
@@ -64,7 +64,7 @@
#include <xercesc/util/TransService.hpp>
#include <cstddef>
-#if defined(XML_MACOSX)
+#if defined(__APPLE__)
// Framework includes from ProjectBuilder
#include <CoreServices/CoreServices.h>
#else
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org