From ad8d0af328c2dfefe59359016cc834622143854a Mon Sep 17 00:00:00 2001
From: PeiYong Zhang <peiyongz@apache.org>
Date: Mon, 7 Apr 2003 16:52:13 +0000
Subject: [PATCH] Bug# 18672: IconvGNUTranscoder can't be build when namespaces
 is on.                       Patch from Bacek@yandex-team.ru (Vasily
 Tchekalkin)

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@174899 13f79535-47bb-0310-9956-ffa450edef68
---
 .../IconvGNU/IconvGNUTransService.cpp         | 47 +++++++++++--------
 1 file changed, 27 insertions(+), 20 deletions(-)

diff --git a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
index a97ded1fc..4d3693777 100644
--- a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
+++ b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
@@ -56,6 +56,10 @@
 
 /*
  * $Log$
+ * Revision 1.6  2003/04/07 16:52:13  peiyongz
+ * Bug# 18672: IconvGNUTranscoder can't be build when namespaces is on.
+ *                       Patch from Bacek@yandex-team.ru (Vasily Tchekalkin)
+ *
  * Revision 1.5  2003/03/09 17:03:25  peiyongz
  * PanicHandler
  *
@@ -83,8 +87,31 @@
 #include <errno.h>
 #include <endian.h>
 
+#include <xercesc/util/XMLString.hpp>
+#include <xercesc/util/XMLUniDefs.hpp>
+#include <xercesc/util/XMLUni.hpp>
+#include <xercesc/util/PlatformUtils.hpp>
+#include <xercesc/util/TranscodingException.hpp>
+#include "IconvGNUTransService.hpp"
+
+#if !defined(APP_NO_THREADS)
+#include <xercesc/util/Mutexes.hpp>
+#endif /* !APP_NO_THREADS */
+
 XERCES_CPP_NAMESPACE_BEGIN
 
+#if !defined(APP_NO_THREADS)
+
+// Iconv() access syncronization point
+static XMLMutex    *gIconvMutex = NULL;
+#  define ICONV_LOCK    XMLMutexLock lockConverter(gIconvMutex);
+
+#else /* APP_NO_THREADS */
+
+# define ICONV_LOCK
+
+#endif /* !APP_NO_THREADS */
+
 // ---------------------------------------------------------------------------
 // Description of encoding schemas, supported by iconv()
 // ---------------------------------------------------------------------------
@@ -164,13 +191,6 @@ static const IconvGNUEncoding    gIconvGNUEncodings[] = {
 #include <wchar.h>
 
 
-#include <xercesc/util/XMLString.hpp>
-#include <xercesc/util/XMLUniDefs.hpp>
-#include <xercesc/util/XMLUni.hpp>
-#include <xercesc/util/PlatformUtils.hpp>
-#include <xercesc/util/TranscodingException.hpp>
-#include "IconvGNUTransService.hpp"
-
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -201,19 +221,6 @@ static unsigned int getWideCharLength(const XMLCh* const src)
 }
 
 
-#if !defined(APP_NO_THREADS)
-
-#include <xercesc/util/Mutexes.hpp>
-// Iconv() access syncronization point
-static XMLMutex    *gIconvMutex = NULL;
-#  define ICONV_LOCK    XMLMutexLock lockConverter(gIconvMutex);
-
-#else /* APP_NO_THREADS */
-
-# define ICONV_LOCK
-
-#endif /* !APP_NO_THREADS */
-
 //----------------------------------------------------------------------------
 // There is implementation of the libiconv for FreeBSD (available through the
 // ports collection). The following is a wrapper around the iconv().
-- 
GitLab