]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - include/platform_defs.h.in
xfs_scrub: fix media verification thread pool size calculations
[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>
2bba5a01 22#include <sys/param.h>
865f1075 23#include <limits.h>
a2ceac1f 24#include <stdbool.h>
b9bc59cb 25#include <libgen.h>
6bef826c 26
5e656dbb 27typedef struct filldir filldir_t;
1707056a 28
2bd0ea18 29/* long and pointer must be either 32 bit or 64 bit */
865f1075
JE
30#undef SIZEOF_LONG
31#undef SIZEOF_CHAR_P
32#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
044fe078 33
cd960ece
MS
34/* Check whether to define umode_t ourselves. */
35#ifndef HAVE_UMODE_T
36typedef unsigned short umode_t;
37#endif
38
9440d84d
NS
39/* Define if you want gettext (I18N) support */
40#undef ENABLE_GETTEXT
41#ifdef ENABLE_GETTEXT
42# include <libintl.h>
43# define _(x) gettext(x)
97294b22 44# define N_(x) x
9440d84d
NS
45#else
46# define _(x) (x)
97294b22 47# define N_(x) x
9440d84d
NS
48# define textdomain(d) do { } while (0)
49# define bindtextdomain(d,dir) do { } while (0)
50#endif
6ef2febc 51#include <locale.h>
9440d84d 52
32181a02
NS
53#define IRIX_DEV_BITSMAJOR 14
54#define IRIX_DEV_BITSMINOR 18
55#define IRIX_DEV_MAXMAJ 0x1ff
56#define IRIX_DEV_MAXMIN 0x3ffff
57#define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
58 & IRIX_DEV_MAXMAJ))
59#define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN))
63899e27 60#define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
32181a02 61 | (minor&IRIX_DEV_MAXMIN)))
f97e76b0 62#define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
32181a02 63
4a7c6ada
DC
64#ifndef min
65#define min(a,b) (((a)<(b))?(a):(b))
66#define max(a,b) (((a)>(b))?(a):(b))
67#endif
68
2bba5a01 69/* If param.h doesn't provide it, i.e. for Android */
c9a90185
TT
70#ifndef NBBY
71#define NBBY 8
72#endif
73
5cfd2d5b
DC
74#ifdef DEBUG
75# define ASSERT(EX) assert(EX)
76#else
77# define ASSERT(EX) ((void) 0)
78#endif
79
2bd0ea18 80#endif /* __XFS_PLATFORM_DEFS_H__ */