svn commit: r709093 - in /xalan/c/trunk: ./ Tests/Threads/ samples/ThreadSafe/ src/xalanc/Harness/ src/xalanc/Include/ src/xalanc/PlatformSupport/

[email protected] Thu, 30 Oct 2008 05:56:57 -0000
Newsgroups gmane.text.xml.xalan.cvs
Message-ID <[email protected]>
Author: dbertoni
Date: Wed Oct 29 22:56:56 2008
New Revision: 709093

URL: http://svn.apache.org/viewvc?rev=709093&view=rev
Log:
Changes for mingw and fixes to runConfigure for disabling threads.

Modified:
    xalan/c/trunk/Makefile.incl.in
    xalan/c/trunk/Tests/Threads/ThreadTest.cpp
    xalan/c/trunk/configure
    xalan/c/trunk/configure.in
    xalan/c/trunk/runConfigure
    xalan/c/trunk/samples/ThreadSafe/ThreadSafe.cpp
    xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
    xalan/c/trunk/src/xalanc/Include/GCCDefinitions.hpp
    xalan/c/trunk/src/xalanc/Include/VCPPDefinitions.hpp
    xalan/c/trunk/src/xalanc/PlatformSupport/DoubleSupport.hpp

Modified: xalan/c/trunk/Makefile.incl.in
URL: http://svn.apache.org/viewvc/xalan/c/trunk/Makefile.incl.in?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/Makefile.incl.in (original)
+++ xalan/c/trunk/Makefile.incl.in Wed Oct 29 22:56:56 2008
@@ -114,6 +114,42 @@
 LOCAL_LIB = -L${XSL_LIB_DIR} -l$(LOC_PROJECT_NAME)
 endif
 
+#=============== MINGW SPECIFIC OPTIONS =========================
+
+ifeq ($(PLATFORM), MINGW)
+
+  SUPPORTED = TRUE
+  ALLLIBS = $(LIBS)
+  SHLIBSUFFIX = .dll
+  LINK_SONAME =  
+  EXT=.exe
+
+   LOC_LIB = ${LOC_LIBNAME}${VER}$(SHLIBSUFFIX)
+
+    MESSAGELIB = ${XSL_LIB_DIR}/$(LOC_LIB)
+    LIB = $(LIB_NAME)$(VER)$(SHLIBSUFFIX)
+    SONAME = $(LIB_NAME)$(MS_VER)$(SHLIBSUFFIX)
+    PLATFORM_COMPILE_OPTIONS = -DWIN32 -D_WINDOWS -D__MINGW__ -D${PLATFORM} -fexceptions
+
+  CC1 = $(CXX) $(CXXFLAGS) $(PLATFORM_COMPILE_OPTIONS)
+  CC4 = $(CC1)
+  LDFLAGS += -Wl,--allow-multiple-definition
+  LINK = $(CXX) -D${PLATFORM} ${LDFLAGS}
+
+    MAKE_SHARED = dllwrap --export-all-symbols --driver-name c++ ${LDFLAGS} -o $(XSL_LIB_DIR)/$(LIBNAME)
+
+    MAKE_SHARED_LOC = dllwrap --export-all-symbols --driver-name c++ ${LDFLAGS} -o $(XSL_LIB_DIR)/$(LOC_LIB)
+
+  LOC_OTHER_LINK_PARAMETERS = $(XERCES_LIB)
+  
+  OTHER_LINK_PARAMETERS = $(XALAN_LIB) $(ALLLIBS)
+  
+  OTHER_LINK_LIB_PARAMERES = $(ALLLIBS)
+   
+  export PATH := $(XERCESCROOT)/lib:$(ICULIB_LOC):$(PATH)
+ 
+endif
+
 #=============== CYGWIN SPECIFIC OPTIONS =========================
 
 ifeq ($(PLATFORM), CYGWIN)
@@ -569,7 +605,7 @@
 
 ifndef SUPPORTED
   nogood:
-	  @echo Linux, Solaris, AIX, Compaq Tru64, OS/390, MacOSX, and HP-UX are the only platforms supported.
+	  @echo Linux, Solaris, AIX, Compaq Tru64, OS/390, MacOSX, HP-UX, NETBSD, FREEBSD, CYGWIN, and MINGW are the only platforms supported.
 endif
 
 

Modified: xalan/c/trunk/Tests/Threads/ThreadTest.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/Tests/Threads/ThreadTest.cpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/Tests/Threads/ThreadTest.cpp (original)
+++ xalan/c/trunk/Tests/Threads/ThreadTest.cpp Wed Oct 29 22:56:56 2008
@@ -53,7 +53,7 @@
 
 
 
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 
 #include <csignal>
 #include <process.h>
@@ -93,7 +93,7 @@
     
     
     // This is here for memory leak testing.
-#if defined(_DEBUG)
+#if !defined(NDEBUG) && defined(_MSC_VER)
 #include <crtdbg.h>
 #endif
 
@@ -215,7 +215,7 @@
 const XalanDOMChar*             theSourceFileName = 0;
 
 
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 static BOOL __stdcall
 signalHandler(DWORD     theSignalType)
 {
@@ -246,7 +246,7 @@
 
 
 
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 
 extern "C"
 {
@@ -325,7 +325,7 @@
 
 
 
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 
 extern "C" void theUnparsedThreadRoutine(void* param);
 
@@ -400,7 +400,7 @@
 inline void
 doSleep(unsigned int    theMilliseconds)
 {
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
     Sleep(theMilliseconds);
 #elif defined(XALAN_POSIX2_AVAILABLE)
     usleep(theMilliseconds * 10);
@@ -418,7 +418,7 @@
 {
     theThreadInfo.m_done = false;
 
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 
     const unsigned long     theThreadID =
             _beginthread(theThreadRoutine, 4096, reinterpret_cast<LPVOID>(&theThreadInfo));
@@ -565,7 +565,7 @@
 {
     if (fContinuous == true)
     {
-#if defined(XALAN_WINDOWS)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
         SetConsoleCtrlHandler(
                 signalHandler,
                 TRUE);

Modified: xalan/c/trunk/configure
URL: http://svn.apache.org/viewvc/xalan/c/trunk/configure?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/configure (original)
+++ xalan/c/trunk/configure Wed Oct 29 22:56:56 2008
@@ -2833,6 +2833,7 @@
         *-*-os400*)     platform=OS400 ;;
         *-*-OS400*)     platform=OS400 ;;
         *-*-cygwin*)    platform=CYGWIN ;;
+        *-*-mingw*)     platform=MINGW ;;
         *)              platform=UNKNOWN ;;
 esac
 

Modified: xalan/c/trunk/configure.in
URL: http://svn.apache.org/viewvc/xalan/c/trunk/configure.in?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/configure.in (original)
+++ xalan/c/trunk/configure.in Wed Oct 29 22:56:56 2008
@@ -61,6 +61,7 @@
         *-*-os400*)     platform=OS400 ;;
         *-*-OS400*)     platform=OS400 ;;
         *-*-cygwin*)    platform=CYGWIN ;;
+        *-*-mingw*)     platform=MINGW ;;
         *)              platform=UNKNOWN ;;
 esac
 

Modified: xalan/c/trunk/runConfigure
URL: http://svn.apache.org/viewvc/xalan/c/trunk/runConfigure?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/runConfigure (original)
+++ xalan/c/trunk/runConfigure Wed Oct 29 22:56:56 2008
@@ -153,14 +153,14 @@
     echo "Usage: runConfigure \"options\""
     echo "       where options may be any of the following:"
     echo "       -p <platform> (accepts 'aix', 'linux', 'freebsd', 'netbsd', 'solaris' 'solaris-x86',
-            'hp-10', 'hp-11', 'hp-11-ia64', 'irix', 'tru64', 'macosx', 'os390', 'os400', 'cygwin')"
+            'hp-10', 'hp-11', 'hp-11-ia64', 'irix', 'tru64', 'macosx', 'os390', 'os400', 'cygwin' 'mingw-msys')"
     echo "       -c <C compiler name> (e.g. gcc, cc, xlc)"
     echo "       -x <C++ compiler name> (e.g. g++, CC, xlC)"
     echo "       -d (specifies that you want to build debug version)"
     echo "       -t <transcoder> can be 'icu' (everything else means default)"
     echo "       -m <msg locale system> (accepts 'inmem', 'icu','nls')" 
     echo "       -M <locale> (example: 'fr_FR'. Default: 'en_US')"     
-    echo "       -r <thread option> can be 'pthread' or 'dce' (only used on HP-11)"
+    echo "       -r <thread option> can be 'pthread' or 'none' (Default: pthread)"
     echo "       -b <bitsToBuild> (accepts '64', '32')"
     echo "       -P <install-prefix>"
     echo "       -l <extra linker options>"
@@ -195,8 +195,9 @@
 debug=off                # by default debug is off
 bitsToBuild=32           # by default 32 bit build assumed
 transcoder=default       # by default use default transcoder
-localSys=inmem 	         # by default use inmem locale system
+localSys=inmem           # by default use inmem locale system
 locale=en_US             # by default use US locale
+thread=pthread           # by default, use pthread
 
 # Get the command line parameters
 if test -x /bin/getopt -o -x /usr/bin/getopt; then
@@ -228,13 +229,13 @@
         
    -m)
 
- 	localSys=$2; shift 2;;
- 	
+    localSys=$2; shift 2;;
+    
 
    -M)
 
-    	locale=$2; shift 2;;
-    	
+        locale=$2; shift 2;;
+        
    -r) 
         thread=$2; shift 2;;
 
@@ -271,7 +272,7 @@
    do
    case $switch in
    p)
-	platform=$OPTARG;;
+    platform=$OPTARG;;
 
    c)
         ccompiler=$OPTARG;;
@@ -340,7 +341,7 @@
 #
 
 case $platform in
-   aix | linux | freebsd | netbsd | solaris | solaris-x86 | hp-11 | hp-11-ia64 | irix | tru64 | macosx | os390 | os400 | cygwin)
+   aix | linux | freebsd | netbsd | solaris | solaris-x86 | hp-11 | hp-11-ia64 | irix | tru64 | macosx | os390 | os400 | cygwin | mingw-msys)
        # platform has been recognized
        ;;
    *)
@@ -360,11 +361,11 @@
     elif test $platform = "os390"; then
         debugflag="-DNDEBUG";
     elif test $platform = "linux"; then
-		if test $cppcompiler = "icpc"; then
-			debugflag="-O3 -DNDEBUG";
-		else
-			debugflag="-O2 -DNDEBUG";
-		fi
+        if test $cppcompiler = "icpc"; then
+            debugflag="-O3 -DNDEBUG";
+        else
+            debugflag="-O2 -DNDEBUG";
+        fi
     else
         debugflag="-O -DNDEBUG";
     fi
@@ -400,7 +401,7 @@
               bitstobuildDefines=" $bitstobuildDefines +DA2.0W "
               bitstobuildLink=" +DA2.0W " ;;
            hp-11-ia64)
-	          bitstobuildDefines=" $bitstobuildDefines +DD64 "
+              bitstobuildDefines=" $bitstobuildDefines +DD64 "
               bitstobuildLink=" +DD64 " ;;
            linux)
               bitstobuildDefines=" $bitstobuildDefines " ;;
@@ -414,18 +415,15 @@
     if test $platform; then
         case $platform in
            solaris)
-		      ;;
+              ;;
            aix)
-		      ;;
+              ;;
            hp-11)
               bitstobuildDefines="+DAportable "
-			  ;;
+              ;;
            hp-11-ia64)
               bitstobuildDefines="+DD32 "
-			  ;;
-           hp-11-ia64)
-              bitstobuildDefines=" $bitstobuildDefines +DD32 "
-                        ;;
+              ;;
            linux)
               ;;
            *)
@@ -450,21 +448,21 @@
 if test $transcoder; then
     case $transcoder in
         icu)
-	    if test ${ICUROOT}o = "o"; then
-		    echo '***Error*** ICUROOT environment variable not defined. Exiting...';
-		    exit ${ERROR_EXIT_CODE};
+        if test ${ICUROOT}o = "o"; then
+            echo '***Error*** ICUROOT environment variable not defined. Exiting...';
+            exit ${ERROR_EXIT_CODE};
             fi
-	    transcodingDefines="-I${ICUROOT}/include";
+        transcodingDefines="-I${ICUROOT}/include";
             if test $platform != "os390"; then
-	            transcodingLibs="-L${ICUROOT} -L${ICUROOT}/lib -L${ICUROOT}/data";
+                transcodingLibs="-L${ICUROOT} -L${ICUROOT}/lib -L${ICUROOT}/data";
             fi
 	    TRANSCODER=icu;;
 
-	default)
-	    ;;
-	*)
-	    echo "Unknown transcoder '$transcoder'. Using default."
-	    ;;
+    default)
+        ;;
+    *)
+        echo "Unknown transcoder '$transcoder'. Using default."
+        ;;
     esac
 fi
 
@@ -474,87 +472,89 @@
 XALAN_LOCALE_SYSTEM=
 
 if test $localSys; then
-	case $localSys in
-		icu)
-			if test ${ICUROOT}o = "o"; then
-			      echo '***Error*** ICUROOT environment variable not defined. Exiting...'
-	              exit ${ERROR_EXIT_CODE};
-	        fi
-			XALAN_LOCALE_SYSTEM=icu;;
-
-		inmem)
-			XALAN_LOCALE_SYSTEM=inmem;;
-
-		nls)
-			XALAN_LOCALE_SYSTEM=nls;;
-
-		default)
-			XALAN_LOCALE_SYSTEM=inmem;;
-
-		*)
-			echo "Unknown locale '$localSys'. Using default."
-	esac
-fi
-
-export XALAN_LOCALE_SYSTEM
+    case $localSys in
+        icu)
+            if test ${ICUROOT}o = "o"; then
+                  echo '***Error*** ICUROOT environment variable not defined. Exiting...'
+                  exit ${ERROR_EXIT_CODE};
+            fi
+            XALAN_LOCALE_SYSTEM=icu;;
 
-XALAN_LOCALE=$locale
+        inmem)
+            XALAN_LOCALE_SYSTEM=inmem;;
 
-export XALAN_LOCALE 
+        nls)
+            XALAN_LOCALE_SYSTEM=nls;;
 
-#
-# Check for the threading option
-#
+        default)
+            XALAN_LOCALE_SYSTEM=inmem;;
 
-threadingLibs="-lpthread"
-if test $platform = "hp-11"; then
-    if test $thread; then
-    case $thread in
-       pthread)
-           ;;
-    
-       dce)
-           threadingLibs="-lcma";
-           threadingDefines="-D_PTHREADS_DRAFT4 -DXML_USE_DCE" ;;
-    
-       *)
-           echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help."
-           exit ${ERROR_EXIT_CODE};;
+        *)
+            echo "Unknown locale '$localSys'. Using default."
     esac
-    fi
-elif test $platform = "aix"; then
-    threadingLibs="-lpthreads"
-elif test $platform = "freebsd"; then
-    if test -n "${PTHREAD_LIBS}" ; then
-      threadingLibs="${PTHREAD_LIBS}"
-      threadingDefines="${PTHREAD_CFLAGS}"
-    else
-      threadingLibs="-lpthread"
-      threadingDefines=""
-    fi
-elif test $platform = "netbsd"; then
-    threadingLibs="-pthread -lpthread"
-elif test $platform = "os400"; then
-    threadingLibs=""
-elif test $platform = "os390"; then
-     threadingLibs=""
-     threadingDefines="-D_OPEN_THREADS"
 fi
 
+export XALAN_LOCALE_SYSTEM
 
+XALAN_LOCALE=$locale
 
+export XALAN_LOCALE 
 
 #
 # Set the C compiler and C++ compiler environment variables
 #
 
+case $ccompiler in
+    gcc | icc)
+        ;;
+
+    cc)
+        if test $platform = "aix"; then
+            echo "Please use xlc instead of cc to build on AIX."
+            exit ${ERROR_EXIT_CODE}
+        fi
+        ;;
+
+    xlc)
+        if test $cppcompiler != "xlC"; then
+            echo "Please use xlC as the C++ compiler when using xlc."
+            exit ${ERROR_EXIT_CODE}
+        fi
+        ;;
+
+    xlc_r)
+        if test $cppcompiler != "xlC_r"; then
+            echo "Please use xlC_r as the C++ compiler when using xlc_r."
+            exit ${ERROR_EXIT_CODE}
+        fi
+        ;;
+
+    *)
+        echo "I do not recognize the C compiler '$ccompiler'. Continuing anyway ..." 
+        ;;
+esac
+
 case $cppcompiler in
-   xlC | xlc | xlC_r | xlc_r | g++ | c++ | cc | CC | aCC | cxx | icpc | icc)
-      ;;
+    g++ | c++ | CC | aCC | cxx | icpc | icc)
+        ;;
 
-   *)
-      echo "I do not recognize the C++ compiler '$cppcompiler'. Continuing anyway ..." 
-      ;;
+    xlC)
+        if test $ccompiler != "xlc"; then
+            echo "Please use xlc as the C compiler when using xlC."
+            exit ${ERROR_EXIT_CODE}
+        fi
+        ;;
+
+    xlC_r)
+        if test $compiler != "xlc_r"; then
+            echo "Please use xlc_r as the C compiler when using xlC_r."
+            exit ${ERROR_EXIT_CODE}
+        fi
+        ;;
+
+    *)
+        echo "I do not recognize the C++ compiler '$cppcompiler'. Continuing anyway ..." 
+        ;;
 esac
 
 CC="$ccompiler"
@@ -565,6 +565,109 @@
 
 
 #
+# Check for the threading option
+#
+
+threadingLibs=""
+threadingDefines=""
+gccThreadingDefines="-pthread -D_REENTRANT"
+gccThreadingLibs="-lpthread"
+
+if test $thread = "none"; then
+    case $platform in
+        aix)
+            if test $ccompiler = "xlc_r"; then
+                echo "Please use xlc instead of xlc_r to build without threads."
+                exit ${ERROR_EXIT_CODE}
+            fi
+
+            if test $cppcompiler = "xlC_r"; then
+                echo "Please use xlC instead of xlC_r to build without threads."
+                exit ${ERROR_EXIT_CODE}
+            fi
+        ;;
+
+        *)
+        ;;
+
+    esac
+elif test $thread != "pthread"; then
+    echo "I do not recognize the thread option '$thread'. Please type '${0} -h' for help."
+    exit ${ERROR_EXIT_CODE}
+else
+    case $platform in
+        aix)
+            if test $ccompiler = "xlc"; then
+                echo "Please use xlc_r instead of xlc to build with threads."
+                exit ${ERROR_EXIT_CODE}
+            elif $ccompiler = "gcc"; then
+                threadingDefines=$gccThreadingDefines
+                threadingLibs=$gccThreadingLibs
+            fi
+
+            if test $cppcompiler = "xlC"; then
+                echo "Please use xlC_r instead of xlC to build with threads."
+                exit ${ERROR_EXIT_CODE}
+            fi
+            ;;
+
+        freebsd)
+            if test -n "${PTHREAD_LIBS}" ; then
+                threadingLibs="${PTHREAD_LIBS}"
+                threadingDefines="${PTHREAD_CFLAGS}"
+            else
+                threadingDefines=$gccThreadingDefines
+                threadingLibs=$gccThreadingLibs
+            fi
+            ;;
+
+        os400)
+            threadingDefines="-D_MULTI_THREADED"
+            ;;
+
+        os390)
+            threadingDefines="-D_OPEN_THREADS"
+            ;;
+
+        solaris)
+            if test $ccompiler = "gcc"; then
+                # GCC on Solaris uses "-pthreads" instead of
+                # "-pthread"
+                threadingDefines="-pthreads -D_REENTRANT"
+                threadingLibs=$gccThreadingLibs
+            else
+                threadingDefines="-mt"
+                threadingLibs="-lpthread"
+            fi
+            ;;
+
+        hp-11*)
+            if test $ccompiler = "gcc"; then
+                threadingDefines=$gccThreadingDefines
+                threadingLibs=$gccThreadingLibs
+            else
+                threadingDefines="-mt"   
+            fi
+            ;;
+
+        cygwin)
+            threadingLibs=""
+            threadingDefines=""
+            ;;
+
+        mingw-msys)
+            threadingLibs="-mthreads"
+            threadingDefines="-mthreads"
+            ;;
+
+        *)
+            threadingDefines=$gccThreadingDefines
+            threadingLibs=$gccThreadingLibs
+        ;;
+    esac
+fi
+
+#
 # Set the extra C and C++ compiler flags
 #
 
@@ -574,7 +677,7 @@
 CFLAGS="$compileroptions $debugflag $transcodingDefines $threadingDefines $bitstobuildDefines "
 export CFLAGS
 
-LDFLAGS="$LDFLAGS $linkeroptions $bitstobuildLink"
+LDFLAGS="$LDFLAGS $linkeroptions $bitstobuildLink $threadingDefines"
 export LDFLAGS
 
 LIBS="$transcodingLibs $threadingLibs "

Modified: xalan/c/trunk/samples/ThreadSafe/ThreadSafe.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/samples/ThreadSafe/ThreadSafe.cpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/samples/ThreadSafe/ThreadSafe.cpp (original)
+++ xalan/c/trunk/samples/ThreadSafe/ThreadSafe.cpp Wed Oct 29 22:56:56 2008
@@ -45,18 +45,18 @@
 
 
 //This is here for the Windows threads.
-#if defined(_MSC_VER)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <winbase.h>
 #define THREADFUNCTIONRETURN DWORD WINAPI
-    typedef   DWORD      theThreadIDType;
-    typedef   HANDLE     theThreadType;
+typedef   DWORD      theThreadIDType;
+typedef   HANDLE     theThreadType;
 
 //This is here for Unix threads
 #elif defined(XALAN_POSIX2_AVAILABLE)
 
-    // This is a workaround for a Tru64 compiler bug...
+// This is a workaround for a Tru64 compiler bug...
 #if defined(TRU64)
 #if  defined(XALAN_STRICT_ANSI_HEADERS)
 #include <csetjmp>
@@ -110,8 +110,8 @@
 // beginning and end of the entire operation.
 void
 outputMessage(
-              theThreadIDType  id,
-            const char  msg[])
+            theThreadIDType    id,
+            const char         msg[])
 {
     ostrstream threadMsg;
     
@@ -127,7 +127,7 @@
 }
 
 
-#if defined(_MSC_VER)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 THREADFUNCTIONRETURN
 theThread(LPVOID    param)
 #elif defined(XALAN_POSIX2_AVAILABLE)
@@ -142,7 +142,7 @@
   
     const size_t    number = reinterpret_cast<size_t>(param);
 
-#if defined(_MSC_VER)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
     const theThreadIDType         theThreadID = GetCurrentThreadId();
 
 #elif defined(XALAN_POSIX2_AVAILABLE)
@@ -184,12 +184,12 @@
     }
 
     outputMessage(theThreadID, "Finishing");
-  
-  #if defined(_MSC_VER)
-    return (theResult);
-  #elif defined(XALAN_POSIX2_AVAILABLE)
-        return 0;
-  #endif
+
+#if defined(WINDOWS_THREAD_FUNCTION)
+    return theResult;
+#elif defined(XALAN_POSIX2_AVAILABLE)
+    return 0;
+#endif
 }
 
 
@@ -209,7 +209,7 @@
 
     hThreads.reserve(nThreads);
 
-#if defined(_MSC_VER)
+#if defined(WINDOWS_THREAD_FUNCTIONS)
 
     for (; i < nThreads; ++i)
     {

Modified: xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp (original)
+++ xalan/c/trunk/src/xalanc/Harness/XalanFileUtility.cpp Wed Oct 29 22:56:56 2008
@@ -547,7 +547,7 @@
     if (chdir(theDir))
     {
         //cout << "Couldn't change to " << directory << ", will create it." << endl;
-#if defined(XALAN_WINDOWS)
+#if defined(XALAN_WINDOWS_DIR_FUNCTIONS)
         if (!mkdir(theDir))
 #else
         if (!mkdir(theDir, DIR_MODE_BITS))

Modified: xalan/c/trunk/src/xalanc/Include/GCCDefinitions.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Include/GCCDefinitions.hpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Include/GCCDefinitions.hpp (original)
+++ xalan/c/trunk/src/xalanc/Include/GCCDefinitions.hpp Wed Oct 29 22:56:56 2008
@@ -34,7 +34,6 @@
 
 
 #define XALAN_SGI_BASED_STL
-#define XALAN_POSIX2_AVAILABLE
 #define XALAN_INLINE_INITIALIZATION
 #define XALAN_HAS_CPP_NAMESPACE
 #define XALAN_HAS_STD_ITERATORS
@@ -48,4 +47,12 @@
 #endif
 #endif
 
+#if defined(__MINGW32__)
+#define XALAN_NO_REENTRANT_TIME_FUNCTIONS
+#define XALAN_WINDOWS_DIR_FUNCTIONS
+#define WINDOWS_THREAD_FUNCTIONS
+#else
+#define XALAN_POSIX2_AVAILABLE
+#endif
+
 #endif  // GCCDEFINITIONS_HEADER_GUARD_1357924680

Modified: xalan/c/trunk/src/xalanc/Include/VCPPDefinitions.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/Include/VCPPDefinitions.hpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/Include/VCPPDefinitions.hpp (original)
+++ xalan/c/trunk/src/xalanc/Include/VCPPDefinitions.hpp Wed Oct 29 22:56:56 2008
@@ -66,6 +66,8 @@
 typedef INT64  XALAN_INT64;
 
 #define XALAN_WINDOWS
+#define XALAN_WINDOWS_DIR_FUNCTIONS
+#define WINDOWS_THREAD_FUNCTIONS
 
 #if defined(_DEBUG) && defined(NDEBUG)
 #error NDEBUG must not be defined when _DEBUG is defined.

Modified: xalan/c/trunk/src/xalanc/PlatformSupport/DoubleSupport.hpp
URL: http://svn.apache.org/viewvc/xalan/c/trunk/src/xalanc/PlatformSupport/DoubleSupport.hpp?rev=709093&r1=709092&r2=709093&view=diff
==============================================================================
--- xalan/c/trunk/src/xalanc/PlatformSupport/DoubleSupport.hpp (original)
+++ xalan/c/trunk/src/xalanc/PlatformSupport/DoubleSupport.hpp Wed Oct 29 22:56:56 2008
@@ -79,7 +79,7 @@
     {
 #if defined(_MSC_VER)
         return _isnan(theNumber) != 0;
-#elif defined(XALAN_POSIX2_AVAILABLE) && !defined(CYGWIN)
+#elif defined(XALAN_POSIX2_AVAILABLE) && !defined(CYGWIN) && !defined(MINGW)
         return isnan(theNumber) != 0;
 #else
         return s_NaN == theNumber;