| /* |
| * Copyright (c) 2000-2005 Silicon Graphics, Inc. |
| * All Rights Reserved. |
| * |
| * This program is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU Lesser General Public License |
| * as published by the Free Software Foundation. |
| * |
| * This program is distributed in the hope that it would be useful, |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| * GNU Lesser General Public License for more details. |
| * |
| * You should have received a copy of the GNU Lesser General Public License |
| * along with this program; if not, write the Free Software Foundation, |
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| * |
| * @configure_input@ |
| */ |
| #ifndef __XFS_PLATFORM_DEFS_H__ |
| #define __XFS_PLATFORM_DEFS_H__ |
| |
| #include <stdio.h> |
| #include <errno.h> |
| #include <fcntl.h> |
| #include <stdarg.h> |
| #include <assert.h> |
| #include <stddef.h> |
| #include <stdlib.h> |
| #include <string.h> |
| #include <stdint.h> |
| #include <unistd.h> |
| #include <pthread.h> |
| #include <ctype.h> |
| #include <sys/types.h> |
| #include <limits.h> |
| #include <stdbool.h> |
| #include <libgen.h> |
| |
| typedef struct filldir filldir_t; |
| |
| /* long and pointer must be either 32 bit or 64 bit */ |
| #undef SIZEOF_LONG |
| #undef SIZEOF_CHAR_P |
| #define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT) |
| |
| /* Check whether to define umode_t ourselves. */ |
| #ifndef HAVE_UMODE_T |
| typedef unsigned short umode_t; |
| #endif |
| |
| /* Define if you want gettext (I18N) support */ |
| #undef ENABLE_GETTEXT |
| #ifdef ENABLE_GETTEXT |
| # include <libintl.h> |
| # define _(x) gettext(x) |
| # define N_(x) x |
| #else |
| # define _(x) (x) |
| # define N_(x) x |
| # define textdomain(d) do { } while (0) |
| # define bindtextdomain(d,dir) do { } while (0) |
| #endif |
| #include <locale.h> |
| |
| #define IRIX_DEV_BITSMAJOR 14 |
| #define IRIX_DEV_BITSMINOR 18 |
| #define IRIX_DEV_MAXMAJ 0x1ff |
| #define IRIX_DEV_MAXMIN 0x3ffff |
| #define IRIX_DEV_MAJOR(dev) ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \ |
| & IRIX_DEV_MAXMAJ)) |
| #define IRIX_DEV_MINOR(dev) ((int)((dev) & IRIX_DEV_MAXMIN)) |
| #define IRIX_MKDEV(major,minor) ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \ |
| | (minor&IRIX_DEV_MAXMIN))) |
| #define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev)) |
| |
| #ifndef min |
| #define min(a,b) (((a)<(b))?(a):(b)) |
| #define max(a,b) (((a)>(b))?(a):(b)) |
| #endif |
| |
| #ifndef NBBY |
| #define NBBY 8 |
| #endif |
| |
| #ifdef DEBUG |
| # define ASSERT(EX) assert(EX) |
| #else |
| # define ASSERT(EX) ((void) 0) |
| #endif |
| |
| #endif /* __XFS_PLATFORM_DEFS_H__ */ |