]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/platform_defs.h.in
xfs: automatic dfops buffer relogging
[thirdparty/xfsprogs-dev.git] / include / platform_defs.h.in
CommitLineData
959ef981 1// SPDX-License-Identifier: LGPL-2.1
2bd0ea18 2/*
f302e9e4
NS
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
2bd0ea18
NS
5 */
6#ifndef __XFS_PLATFORM_DEFS_H__
7#define __XFS_PLATFORM_DEFS_H__
8
9#include <stdio.h>
6bef826c
NS
10#include <errno.h>
11#include <fcntl.h>
b26ade3f 12#include <stdarg.h>
2bd0ea18 13#include <assert.h>
2bd0ea18
NS
14#include <stddef.h>
15#include <stdlib.h>
16#include <string.h>
5e656dbb 17#include <stdint.h>
2bd0ea18 18#include <unistd.h>
5e656dbb
BN
19#include <pthread.h>
20#include <ctype.h>
2bd0ea18 21#include <sys/types.h>
865f1075 22#include <limits.h>
a2ceac1f 23#include <stdbool.h>
b9bc59cb 24#include <libgen.h>
6bef826c 25
5e656dbb 26typedef struct filldir filldir_t;
1707056a 27
2bd0ea18 28/* long and pointer must be either 32 bit or 64 bit */
865f1075
JE
29#undef SIZEOF_LONG
30#undef SIZEOF_CHAR_P
31#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
044fe078 32
cd960ece
MS
33/* Check whether to define umode_t ourselves. */
34#ifndef HAVE_UMODE_T
35typedef unsigned short umode_t;
36#endif
37
9440d84d
NS
38/* Define if you want gettext (I18N) support */
39#undef ENABLE_GETTEXT
40#ifdef ENABLE_GETTEXT
41# include <libintl.h>
42# define _(x) gettext(x)
97294b22 43# define N_(x) x
9440d84d
NS
44#else
45# define _(x) (x)
97294b22 46# define N_(x) x
9440d84d
NS
47# define textdomain(d) do { } while (0)
48# define bindtextdomain(d,dir) do { } while (0)
49#endif
6ef2febc 50#include <locale.h>
9440d84d 51
32181a02
NS
52#define IRIX_DEV_BITSMAJOR 14
53#define IRIX_DEV_BITSMINOR 18
54#define IRIX_DEV_MAXMAJ 0x1ff
55#define IRIX_DEV_MAXMIN 0x3ffff
56#define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
57 & IRIX_DEV_MAXMAJ))
58#define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN))
63899e27 59#define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
32181a02 60 | (minor&IRIX_DEV_MAXMIN)))
f97e76b0 61#define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
32181a02 62
4a7c6ada
DC
63#ifndef min
64#define min(a,b) (((a)<(b))?(a):(b))
65#define max(a,b) (((a)>(b))?(a):(b))
66#endif
67
c9a90185
TT
68#ifndef NBBY
69#define NBBY 8
70#endif
71
5cfd2d5b
DC
72#ifdef DEBUG
73# define ASSERT(EX) assert(EX)
74#else
75# define ASSERT(EX) ((void) 0)
76#endif
77
2bd0ea18 78#endif /* __XFS_PLATFORM_DEFS_H__ */