Mercurial > gub
view patches/openoffice-transex3-mingw.patch @ 6512:ccc20ae889ca default tip guix
mingw::guile-2.0.7 builds.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Thu, 24 Mar 2016 08:03:39 +0100 |
parents | e837b64a001f |
children |
line wrap: on
line source
diff --git transex3/source/xmlparse.cxx transex3/source/xmlparse.cxx index 3b9bc34..58d1e6e 100644 --- transex3/source/xmlparse.cxx +++ transex3/source/xmlparse.cxx @@ -32,14 +32,14 @@ #include "precompiled_transex3.hxx" #include <iterator> /* std::iterator*/ - #include <stdio.h> #include <sal/alloca.h> #include "xmlparse.hxx" #include <fstream> #include <iostream> -#include "osl/mutex.hxx" +#include <osl/mutex.hxx> +#include <osl/thread.hxx> using namespace std; using namespace osl; @@ -278,11 +278,11 @@ BOOL XMLFile::Write( ByteString &aFilename ) if( !aFStream ) // From time to time the stream can not be opened the first time on NFS volumes, { // I wasn't able to track this down. I think this is an NFS issue ..... //cerr << "ERROR: - helpex - Can't write to tempfile " << aFilename.GetBuffer() << " No#" << x << "\n"; -#ifdef UNX - sleep( 3 ); -#else - Sleep( 3 ); -#endif + TimeValue aTime; + aTime.Seconds = 3; + aTime.Nanosec = 0; + + osl::Thread::wait( aTime ); } else { diff --git xmlhelp/source/com/sun/star/help/HelpCompiler.cxx xmlhelp/source/com/sun/star/help/HelpCompiler.cxx index 38804e7..7802dc0 100644 --- xmlhelp/source/com/sun/star/help/HelpCompiler.cxx +++ xmlhelp/source/com/sun/star/help/HelpCompiler.cxx @@ -37,6 +37,16 @@ #include <libxslt/xsltInternals.h> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> +#include <osl/thread.hxx> + +static void impl_sleep( sal_uInt32 nSec ) +{ + TimeValue aTime; + aTime.Seconds = nSec; + aTime.Nanosec = 0; + + osl::Thread::wait( aTime ); +} HelpCompiler::HelpCompiler(StreamTable &in_streamTable, const fs::path &in_inputFile, const fs::path &in_src, const fs::path &in_resEmbStylesheet, @@ -58,12 +68,8 @@ xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath) { res = xmlParseFile(filePath.native_file_string().c_str()); if( !res ){ -#ifdef UNX - sleep( 3 ); -#else - Sleep( 3 ); -#endif - res = xmlParseFile(filePath.native_file_string().c_str()); + impl_sleep( 3 ); + res = xmlParseFile(filePath.native_file_string().c_str()); } } else @@ -87,11 +93,7 @@ xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath) xmlDocPtr doc = xmlParseFile(filePath.native_file_string().c_str()); if( !doc ) { -#ifdef UNX - sleep( 3 ); -#else - Sleep( 3 ); -#endif + impl_sleep( 3 ); doc = xmlParseFile(filePath.native_file_string().c_str()); } @@ -412,11 +414,7 @@ bool HelpCompiler::compile( void ) throw( HelpProcessingException ) // resolve the dom if (!docResolvedOrg) { -#ifdef UNX - sleep( 3 ); -#else - Sleep( 3 ); -#endif + impl_sleep( 3 ); docResolvedOrg = getSourceDocument(inputFile); if( !docResolvedOrg ) {