]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/platform_defs.h.in
libxfs: fix fsmap.h inclusion
[thirdparty/xfsprogs-dev.git] / include / platform_defs.h.in
CommitLineData
2bd0ea18 1/*
f302e9e4
NS
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
2bd0ea18 4 *
f302e9e4
NS
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public License
7 * as published by the Free Software Foundation.
2bd0ea18 8 *
f302e9e4
NS
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
2bd0ea18 13 *
f302e9e4
NS
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2bd0ea18
NS
17 *
18 * @configure_input@
19 */
20#ifndef __XFS_PLATFORM_DEFS_H__
21#define __XFS_PLATFORM_DEFS_H__
22
23#include <stdio.h>
6bef826c
NS
24#include <errno.h>
25#include <fcntl.h>
b26ade3f 26#include <stdarg.h>
2bd0ea18 27#include <assert.h>
2bd0ea18
NS
28#include <stddef.h>
29#include <stdlib.h>
30#include <string.h>
5e656dbb 31#include <stdint.h>
2bd0ea18 32#include <unistd.h>
5e656dbb
BN
33#include <pthread.h>
34#include <ctype.h>
2bd0ea18 35#include <sys/types.h>
865f1075 36#include <limits.h>
a2ceac1f 37#include <stdbool.h>
b9bc59cb 38#include <libgen.h>
6bef826c 39
5e656dbb 40typedef struct filldir filldir_t;
1707056a 41
2bd0ea18 42/* long and pointer must be either 32 bit or 64 bit */
865f1075
JE
43#undef SIZEOF_LONG
44#undef SIZEOF_CHAR_P
45#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
044fe078 46
cd960ece
MS
47/* Check whether to define umode_t ourselves. */
48#ifndef HAVE_UMODE_T
49typedef unsigned short umode_t;
50#endif
51
9440d84d
NS
52/* Define if you want gettext (I18N) support */
53#undef ENABLE_GETTEXT
54#ifdef ENABLE_GETTEXT
55# include <libintl.h>
56# define _(x) gettext(x)
97294b22 57# define N_(x) x
9440d84d
NS
58#else
59# define _(x) (x)
97294b22 60# define N_(x) x
9440d84d
NS
61# define textdomain(d) do { } while (0)
62# define bindtextdomain(d,dir) do { } while (0)
63#endif
6ef2febc 64#include <locale.h>
9440d84d 65
32181a02
NS
66#define IRIX_DEV_BITSMAJOR 14
67#define IRIX_DEV_BITSMINOR 18
68#define IRIX_DEV_MAXMAJ 0x1ff
69#define IRIX_DEV_MAXMIN 0x3ffff
70#define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
71 & IRIX_DEV_MAXMAJ))
72#define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN))
63899e27 73#define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
32181a02 74 | (minor&IRIX_DEV_MAXMIN)))
f97e76b0 75#define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
32181a02 76
4a7c6ada
DC
77#ifndef min
78#define min(a,b) (((a)<(b))?(a):(b))
79#define max(a,b) (((a)>(b))?(a):(b))
80#endif
81
c9a90185
TT
82#ifndef NBBY
83#define NBBY 8
84#endif
85
5cfd2d5b
DC
86#ifdef DEBUG
87# define ASSERT(EX) assert(EX)
88#else
89# define ASSERT(EX) ((void) 0)
90#endif
91
2bd0ea18 92#endif /* __XFS_PLATFORM_DEFS_H__ */