From: cas Date: Tue, 31 Jul 2001 17:44:49 +0000 (+0000) Subject: No comments X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=314c95adb6be35067a88631309f70057e0fe6226;p=occt-wok.git No comments --- diff --git a/src/WOKUnix/WOKUnix_FDescr.cxx b/src/WOKUnix/WOKUnix_FDescr.cxx index 665fa20..5d974df 100755 --- a/src/WOKUnix/WOKUnix_FDescr.cxx +++ b/src/WOKUnix/WOKUnix_FDescr.cxx @@ -1,16 +1,30 @@ #ifndef WNT +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include -#include + +#ifdef HAVE_UNISTD_H +# include +#endif + #include +#ifdef HAVE_SYS_FILIO_H +# include +#endif + +#ifdef HAVE_SYS_IOCTL_H +# include +#endif -#ifdef SOLARIS -#include -#else -#include +#if defined(HAVE_SYS_VNODE_H) && defined(__FreeBSD__) +# include #endif + #include #include @@ -27,9 +41,9 @@ extern int errno; const OSD_WhoAmI Iam = OSD_WFile; -#ifdef LIN +#ifdef __GNUC__ static FILE* _wokunix_fdopen ( int ); -#endif // LIN +#endif // __GNUC__ //======================================================================= //function : WOKUnix_FDescr @@ -46,11 +60,11 @@ WOKUnix_FDescr::WOKUnix_FDescr() //======================================================================= WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd) { myFileChannel = afd; -#ifndef LIN +#ifndef __GNUC__ myFILE = fdopen(afd, "r"); #else myFILE = _wokunix_fdopen ( afd ); -#endif // LIN +#endif // __GNUC__ } //======================================================================= @@ -60,11 +74,11 @@ WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd) { WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd, const Handle(TCollection_HAsciiString)& apath) { myFileChannel = afd; -#ifndef LIN +#ifndef __GNUC__ myFILE = fdopen(afd, "r"); #else myFILE = _wokunix_fdopen ( afd ); -#endif // LIN +#endif // __GNUC__ SetPath(apath->String()); } @@ -114,7 +128,11 @@ Standard_Integer WOKUnix_FDescr::GetNbToRead() //======================================================================= void WOKUnix_FDescr::SetUnBuffered() { +#ifdef __FreeBSD__ + if(fcntl(myFileChannel, F_SETFL, O_ASYNC) < 0) +#else if(fcntl(myFileChannel, F_SETFL, O_SYNC) < 0) +#endif { Perror(); return; @@ -405,7 +423,7 @@ WOKUnix_FDescr WOKUnix_FDescr::Stderr() return StderrFD; } -#ifdef LIN +#ifdef __GNUC__ static FILE* _wokunix_fdopen ( int fd ) { char* fdMode = "r"; @@ -434,6 +452,6 @@ static FILE* _wokunix_fdopen ( int fd ) { return retVal; } // end _wokunix_fdopen -#endif // LIN +#endif // __GNUC__ -#endif +#endif // WNT diff --git a/src/WOKUnix/WOKUnix_FileBuffer.cxx b/src/WOKUnix/WOKUnix_FileBuffer.cxx index e52fa7f..761f371 100755 --- a/src/WOKUnix/WOKUnix_FileBuffer.cxx +++ b/src/WOKUnix/WOKUnix_FileBuffer.cxx @@ -1,6 +1,5 @@ #ifndef WNT - #include #include @@ -87,16 +86,16 @@ Handle(TColStd_HSequenceOfHAsciiString) WOKUnix_FileBuffer::Echo() //======================================================================= void WOKUnix_FileBuffer::Acquit(const Standard_Integer astatus, const WOKUnix_FDSet& aset) { -#ifndef LIN +#ifndef __GNUC__ Standard_Integer nbtoread = GetFDescr().GetNbToRead(); -#endif // LIN -#if defined( WOK_VERBOSE ) && !defined( LIN ) +#endif // __GNUC__ +#if defined( WOK_VERBOSE ) && !defined( __GNUC__ ) VerboseMsg("WOK_PROCESS") << "WOKUnix_FileBuffer::Acquit" << "There is " << nbtoread << " bytes to read on process output" << endm; #endif -#ifndef LIN +#ifndef __GNUC__ if(nbtoread >= MAX_PIPE_SIZE) -#endif // LIN +#endif // __GNUC__ { Dump(); } @@ -156,4 +155,4 @@ void WOKUnix_FileBuffer::Close() if( apath.Name().IsEmpty() != Standard_True && mybuffer.FileNo() >= 0) mybuffer.Close(); WOKUnix_Buffer::Close(); } -#endif +#endif // WNT diff --git a/src/WOKUnix/WOKUnix_Path.cxx b/src/WOKUnix/WOKUnix_Path.cxx index d2b3e91..ccbd581 100755 --- a/src/WOKUnix/WOKUnix_Path.cxx +++ b/src/WOKUnix/WOKUnix_Path.cxx @@ -3,14 +3,20 @@ // Created: Tue May 30 09:17:00 1995 // Author: Jean GAUTIER // +#ifdef HAVE_CONFIG_H +# include +#endif #include -#include + +#ifdef HAVE_UNISTD_H +# include +#endif + #include #include #include #include -#include #include @@ -406,7 +412,7 @@ Handle(WOKUnix_Path) WOKUnix_Path::ReducedPath() const if(Exists()) { -#if !defined(DECOSF1) && !defined(HPUX) +#if !defined(__osf__) && !defined(DECOSF1) && !defined(__hpux) && !defined(HPUX) char abuffer[PATH_MAX]; diff --git a/src/WOKUnix/WOKUnix_Process.cxx b/src/WOKUnix/WOKUnix_Process.cxx index 7419a77..dd6caf6 100755 --- a/src/WOKUnix/WOKUnix_Process.cxx +++ b/src/WOKUnix/WOKUnix_Process.cxx @@ -1,25 +1,41 @@ #ifndef WNT -#ifdef IRIX -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include #endif -#ifdef HPUX -#include -#include -#include +#ifdef HAVE_UNISTD_H +# include #endif -#ifdef AIX -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_BSTRING_H +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_TIME_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include +#endif + +#ifdef HAVE_SYS_WAIT_H +# include +#endif + +#ifdef HAVE_SIGNAL_H +# include #endif -#include -#include -#include #include #include diff --git a/src/WOKUnix/WOKUnix_RemoteShell.cxx b/src/WOKUnix/WOKUnix_RemoteShell.cxx index 7636ecb..65da04d 100755 --- a/src/WOKUnix/WOKUnix_RemoteShell.cxx +++ b/src/WOKUnix/WOKUnix_RemoteShell.cxx @@ -4,21 +4,32 @@ // Author: Jean GAUTIER // -#ifdef IRIX -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include #endif -#ifdef HPUX -#include -#include -#include +#ifdef HAVE_UNISTD_H +# include #endif -#ifdef AIX -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_BSTRING_H +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_TIME_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include #endif #include @@ -156,13 +167,4 @@ Handle(TCollection_HAsciiString) WOKUnix_RemoteShell::Password() const return mypassword; } - - - - - - - - - #endif diff --git a/src/WOKUnix/WOKUnix_Shell.cxx b/src/WOKUnix/WOKUnix_Shell.cxx index feb06d7..0896d0f 100755 --- a/src/WOKUnix/WOKUnix_Shell.cxx +++ b/src/WOKUnix/WOKUnix_Shell.cxx @@ -1,20 +1,31 @@ #ifndef WNT -#ifdef IRIX -#include -#include -#include -#include +#ifdef HAVE_CONFIG_H +# include #endif -#ifdef HPUX -#include -#include -#include +#ifdef HAVE_UNISTD_H +# include #endif -#ifdef AIX -#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_BSTRING_H +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_TIME_H +# include +#endif + +#ifdef HAVE_STRINGS_H +# include #endif #include @@ -444,5 +455,4 @@ Handle(TCollection_HAsciiString) WOKUnix_Shell::Host() const return myhost; } - #endif diff --git a/src/WOKUnix/WOKUnix_Signal.cxx b/src/WOKUnix/WOKUnix_Signal.cxx index d9c70e0..a539189 100755 --- a/src/WOKUnix/WOKUnix_Signal.cxx +++ b/src/WOKUnix/WOKUnix_Signal.cxx @@ -1,4 +1,7 @@ #ifndef WNT +#ifdef HAVE_CONFIG_H +# include +#endif #include @@ -7,10 +10,11 @@ #include #include -#ifdef LIN +#ifdef HAVE_BITS_SIGSET_H #include -#include -#elif !defined(HPUX) && !defined(AIX) +#endif + +#ifdef HAVE_SIGINFO_H #include #endif @@ -62,13 +66,12 @@ void WOKUnix_Signal::Arm(const WOKUnix_SigHandler& ahandler) { act.sa_handler = (WOKUnix_SigHandler) ahandler; } -#ifdef SOLARIS +#if defined(__sun) || defined(__sgi) act.sa_mask.__sigbits[0] = 0; act.sa_mask.__sigbits[1] = 0; act.sa_mask.__sigbits[2] = 0; act.sa_mask.__sigbits[3] = 0; - act.sa_flags = SA_RESTART; -#elif HPUX +#elif defined(__hpux) act.sa_mask.sigset[0] = 0; act.sa_mask.sigset[1] = 0; act.sa_mask.sigset[2] = 0; @@ -77,24 +80,20 @@ void WOKUnix_Signal::Arm(const WOKUnix_SigHandler& ahandler) act.sa_mask.sigset[5] = 0; act.sa_mask.sigset[6] = 0; act.sa_mask.sigset[7] = 0; - act.sa_flags = 0; -#elif IRIX - act.sa_mask.__sigbits[0] = 0; - act.sa_mask.__sigbits[1] = 0; - act.sa_mask.__sigbits[2] = 0; - act.sa_mask.__sigbits[3] = 0; - act.sa_flags = 0; -#elif defined(LIN) +#elif defined(__FreeBSD__) + act.sa_mask.__bits[0] = 0; + act.sa_mask.__bits[1] = 0; + act.sa_mask.__bits[2] = 0; + act.sa_mask.__bits[3] = 0; +#elif defined(linux) sigemptyset(&act.sa_mask) ; - act.sa_flags = 0; -#elif defined(AIX) +#elif defined(_AIX) act.sa_mask.losigs = 0; act.sa_mask.hisigs = 0; - act.sa_flags = 0; - #else +#else act.sa_mask = 0; - act.sa_flags = 0; #endif + act.sa_flags = 0; //==== Always detected the signal "SIGFPE" ================================= stat = sigaction(WOKUnix_Signal::GetSig(mysig),&act,&oact); // ...... floating point exception @@ -127,7 +126,11 @@ int WOKUnix_Signal::GetSig(const WOKUnix_Signals asig) case WOKUnix_SIGKILL : return SIGKILL; case WOKUnix_SIGBUS : return SIGBUS; case WOKUnix_SIGSEGV : return SIGSEGV; +#if defined(SIGCLD) case WOKUnix_SIGCHILD : return SIGCLD; +#elif defined(SIGCHLD) + case WOKUnix_SIGCHILD : return SIGCHLD; +#endif } return 0; } diff --git a/src/WOKUnix/WOKUnix_regexp_1.c b/src/WOKUnix/WOKUnix_regexp_1.c index 3aabdd2..ed89a41 100755 --- a/src/WOKUnix/WOKUnix_regexp_1.c +++ b/src/WOKUnix/WOKUnix_regexp_1.c @@ -1,3 +1,6 @@ +#ifdef HAVE_CONFIG_H +# include +#endif /******************************************************************************/ /* Extended regular expression matching and search. */ /* Copyright (C) 1985 Free Software Foundation, Inc. */ @@ -27,7 +30,7 @@ /* JGA : to compile on Solaris */ -#if !defined(HPUX) && !defined (WNT) && !defined (AIX) +#ifdef HAVE_ALLOCA_H #include #else