]> OCCT Git - occt-wok.git/commitdiff
Portability
authorcas <cas@opencascade.com>
Wed, 31 Oct 2001 18:01:46 +0000 (18:01 +0000)
committercas <cas@opencascade.com>
Wed, 31 Oct 2001 18:01:46 +0000 (18:01 +0000)
src/WOKUnix/WOKUnix_FDescr.cxx
src/WOKUnix/WOKUnix_regexp_1.c

index 5d974df63cc83a82a55fb58b99079d1094cd218a..bb0aed4da75131f1f006badfe9f878d8c01c748a 100755 (executable)
@@ -11,7 +11,9 @@
 # include <unistd.h>
 #endif
 
-#include <sys/stat.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
 
 #ifdef HAVE_SYS_FILIO_H
 # include <sys/filio.h>
@@ -21,7 +23,7 @@
 # include <sys/ioctl.h>
 #endif
 
-#if defined(HAVE_SYS_VNODE_H) && defined(__FreeBSD__) 
+#if defined(HAVE_SYS_VNODE_H) && ( defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) )
 # include <sys/vnode.h>
 #endif
 
index ed89a41c05253e3520ded9025e4276be6ac29ebc..bfc732f86796f5b621b37186acb36711a83fc2ac 100755 (executable)
@@ -1,6 +1,3 @@
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
 /******************************************************************************/
 /* Extended regular expression matching and search.                           */
 /* Copyright (C) 1985 Free Software Foundation, Inc.                          */
 /***/
 
 /* JGA : to compile on Solaris */
-
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-
-#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 <config.h>
 #endif
 
-
 #include <WOKUnix_regexp.h>
 #include <stdlib.h>
 #include <string.h>
 
+/* AIX requires this to be the first thing in the file.  */
+#ifndef __GNUC__
+# if HAVE_ALLOCA_H
+#  include <alloca.h>
+# 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 );