1 /* include/platform_defs.h.  Generated automatically by configure.  */
2 /*
3  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 3 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it would be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * Further, this software is distributed without any warranty that it is
14  * free of the rightful claim of any third person regarding infringement
15  * or the like.  Any license provided herein, whether implied or
16  * otherwise, applies only to this software file.  Patent licenses, if
17  * any, provided herein do not apply to combinations of this program with
18  * other software, or any other product whatsoever.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24  * Mountain View, CA  94043, or:
25  *
26  * http://www.sgi.com
27  *
28  * For further information regarding this notice, see:
29  *
30  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31  *
32  * @configure_input@
33  */
34 #ifndef __XFS_PLATFORM_DEFS_H__
35 #define __XFS_PLATFORM_DEFS_H__
36 
37 #include <stdio.h>
38 #include <stdarg.h>
39 #include <assert.h>
40 #include <stddef.h>
41 #include <stdlib.h>
42 #include <string.h>
43 #include <unistd.h>
44 #include <sys/param.h>
45 #include <sys/types.h>
46 
47 #if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 1)
48 # define constpp	const char * const *
49 #else
50 # define constpp	char * const *
51 #endif
52 
53 #ifdef __sparc__
54 # ifndef O_DIRECT
55 #  define O_DIRECT	0x100000
56 # endif
57 #endif
58 
59 #if defined(__sun)
60 typedef off_t		loff_t;
61 #endif
62 
63 typedef loff_t		xfs_off_t;
64 typedef uint64_t	xfs_ino_t;
65 typedef uint32_t	xfs_dev_t;
66 typedef int64_t         xfs_daddr_t;
67 typedef char*		xfs_caddr_t;
68 
69 /* long and pointer must be either 32 bit or 64 bit */
70 /* #undef HAVE_64BIT_LONG */
71 #define HAVE_32BIT_LONG 1
72 #define HAVE_32BIT_PTR 1
73 /* #undef HAVE_64BIT_PTR */
74 
75 /* Check if __psint_t is set to something meaningful */
76 /* #undef HAVE___PSINT_T */
77 #ifndef HAVE___PSINT_T
78 # ifdef HAVE_32BIT_PTR
79 typedef int __psint_t;
80 # elif defined HAVE_64BIT_PTR
81 #  ifdef HAVE_64BIT_LONG
82 typedef long __psint_t;
83 #  else
84 /* This is a very strange architecture, which has 64 bit pointers but
85  * not 64 bit longs. So, I'd just punt here and assume long long is Ok */
86 typedef long long __psint_t;
87 #  endif
88 # else
89 #  error Unknown pointer size
90 # endif
91 #endif
92 
93 /* Check if __psunsigned_t is set to something meaningful */
94 /* #undef HAVE___PSUNSIGNED_T */
95 #ifndef HAVE___PSUNSIGNED_T
96 # ifdef HAVE_32BIT_PTR
97 typedef unsigned int __psunsigned_t;
98 # elif defined HAVE_64BIT_PTR
99 #  ifdef HAVE_64BIT_LONG
100 typedef long __psunsigned_t;
101 #  else
102 /* This is a very strange architecture, which has 64 bit pointers but
103  * not 64 bit longs. So, I'd just punt here and assume long long is Ok */
104 typedef unsigned long long __psunsigned_t;
105 #  endif
106 # else
107 #  error Unknown pointer size
108 # endif
109 #endif
110 
111 #ifdef DEBUG
112 # define ASSERT		assert
113 #else
114 # define ASSERT(EX)	((void) 0)
115 #endif
116 
117 #endif	/* __XFS_PLATFORM_DEFS_H__ */
118