]> Dogcows Code - chaz/tar/blobdiff - src/port.h
*** empty log message ***
[chaz/tar] / src / port.h
index ee5e22ed125ea817931249a17a4866daace4dde4..fa4b8793bdb26d21528dd69cc7eee33d52078bbc 100644 (file)
@@ -1,5 +1,5 @@
 /* Portability declarations.  Requires sys/types.h.
-   Copyright (C) 1988 Free Software Foundation
+   Copyright (C) 1988, 1992 Free Software Foundation
 
 This file is part of GNU Tar.
 
@@ -17,6 +17,21 @@ You should have received a copy of the GNU General Public License
 along with GNU Tar; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
+/* AIX requires this to be the first thing in the file. */
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not __GNUC__ */
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else /* not HAVE_ALLOCA_H */
+#ifdef _AIX
+ #pragma alloca
+#else /* not _AIX */
+char *alloca ();
+#endif /* not _AIX */
+#endif /* not HAVE_ALLOCA_H */
+#endif /* not __GNUC__ */
+
 #include "pathmax.h"
 
 #ifdef _POSIX_VERSION
@@ -53,19 +68,20 @@ typedef long off_t;
 #define PTR void *
 #else
 #define PTR char *
-#define const
 #endif
 
-/* Since major is a function on SVR4, we can't use `ifndef major'.  */
-#ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
+/* Since major is a function on SVR4, we can't just use `ifndef major'.  */
+#ifdef major                   /* Might be defined in sys/types.h.  */
 #define HAVE_MAJOR
 #endif
-#ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
+
+#if !defined(HAVE_MAJOR) && defined(MAJOR_IN_MKDEV)
+#include <sys/mkdev.h>
 #define HAVE_MAJOR
 #endif
-#ifdef major                   /* Might be defined in sys/types.h.  */
+
+#if !defined(HAVE_MAJOR) && defined(MAJOR_IN_SYSMACROS)
+#include <sys/sysmacros.h>
 #define HAVE_MAJOR
 #endif
 
@@ -81,6 +97,12 @@ typedef long off_t;
 #if !defined(__MSDOS__) && !defined(STDC_HEADERS)
 #include <memory.h>
 #endif
+#ifdef index
+#undef index
+#endif
+#ifdef rindex
+#undef rindex
+#endif
 #define index strchr
 #define rindex strrchr
 #define bcopy(s, d, n) memcpy(d, s, n)
This page took 0.021889 seconds and 4 git commands to generate.