From be207c3abb0182c84944634ed32d8af9b355e211 Mon Sep 17 00:00:00 2001 From: cas Date: Wed, 31 Oct 2001 18:01:46 +0000 Subject: [PATCH] Portability --- src/WOKUnix/WOKUnix_FDescr.cxx | 6 ++++-- src/WOKUnix/WOKUnix_regexp_1.c | 39 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/WOKUnix/WOKUnix_FDescr.cxx b/src/WOKUnix/WOKUnix_FDescr.cxx index 5d974df..bb0aed4 100755 --- a/src/WOKUnix/WOKUnix_FDescr.cxx +++ b/src/WOKUnix/WOKUnix_FDescr.cxx @@ -11,7 +11,9 @@ # include #endif -#include +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_SYS_FILIO_H # include @@ -21,7 +23,7 @@ # include #endif -#if defined(HAVE_SYS_VNODE_H) && defined(__FreeBSD__) +#if defined(HAVE_SYS_VNODE_H) && ( defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) ) # include #endif diff --git a/src/WOKUnix/WOKUnix_regexp_1.c b/src/WOKUnix/WOKUnix_regexp_1.c index ed89a41..bfc732f 100755 --- a/src/WOKUnix/WOKUnix_regexp_1.c +++ b/src/WOKUnix/WOKUnix_regexp_1.c @@ -1,6 +1,3 @@ -#ifdef HAVE_CONFIG_H -# include -#endif /******************************************************************************/ /* Extended regular expression matching and search. */ /* Copyright (C) 1985 Free Software Foundation, Inc. */ @@ -29,27 +26,29 @@ /***/ /* JGA : to compile on Solaris */ - -#ifdef HAVE_ALLOCA_H -#include - -#else -/* alloca() non disponible sur HPUX 9.07 */ -# ifdef __cplusplus -extern "C" { -# endif -void *alloca(unsigned int); -# ifdef __cplusplus -} -#endif -void *alloca(unsigned int size){return (void *)0L;} +#ifdef HAVE_CONFIG_H +# include #endif - #include #include #include +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + /***/ /******************************************************************************/ /* */ @@ -1472,7 +1471,7 @@ int re_match_2 ( if ( stacke - stackb > RE_MAX_FAILURES ) return -2; - stackx = ( _TUCHAR** ) alloca ( 2 * ( stacke - stackb ) * sizeof ( _TCHAR* ) ); + stackx = ( _TUCHAR** ) alloca( 2 * ( stacke - stackb ) * sizeof ( _TCHAR* ) ); memcpy ( stackx, stackb, ( stacke - stackb ) * sizeof ( _TCHAR* ) ); stackp = stackx + ( stackp - stackb ); stacke = stackx + 2 * ( stacke - stackb ); @@ -1562,7 +1561,7 @@ nofinalize: if ( stackp == stacke ) { _TUCHAR** stackx = - ( _TUCHAR** ) alloca ( 2 * ( stacke - stackb ) * sizeof ( _TUCHAR* ) ); + ( _TUCHAR** ) alloca( 2 * ( stacke - stackb ) * sizeof ( _TUCHAR* ) ); memcpy ( stackx, stackb, (stacke - stackb) * sizeof ( _TCHAR* ) ); stackp = stackx + ( stackp - stackb ); -- 2.39.5