Steve Kondik | 2111ad7 | 2013-07-07 12:07:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * compat.h - Tweaks for Windows compatibility. |
| 3 | * |
| 4 | * Copyright (c) 2002 Richard Russon |
| 5 | * Copyright (c) 2002-2004 Anton Altaparmakov |
| 6 | * Copyright (c) 2008-2009 Szabolcs Szakacsits |
| 7 | * |
| 8 | * This program/include file is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as published |
| 10 | * by the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program/include file is distributed in the hope that it will be |
| 14 | * useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
| 15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program (in the main directory of the NTFS-3G |
| 20 | * distribution in the file COPYING); if not, write to the Free Software |
| 21 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | */ |
| 23 | |
| 24 | #ifndef _NTFS_COMPAT_H |
| 25 | #define _NTFS_COMPAT_H |
| 26 | |
| 27 | #ifdef HAVE_CONFIG_H |
| 28 | #include "config.h" |
| 29 | #endif |
| 30 | #ifdef HAVE_SYS_PARAM_H |
| 31 | #include <sys/param.h> |
| 32 | #endif |
| 33 | |
| 34 | #include <errno.h> /* ENODATA */ |
| 35 | |
| 36 | #ifndef ENODATA |
| 37 | #define ENODATA ENOENT |
| 38 | #endif |
| 39 | |
| 40 | #ifndef PATH_MAX |
| 41 | #define PATH_MAX 4096 |
| 42 | #endif |
| 43 | |
| 44 | #ifndef HAVE_FFS |
| 45 | extern int ffs(int i); |
| 46 | #endif /* HAVE_FFS */ |
| 47 | |
| 48 | #ifndef HAVE_DAEMON |
| 49 | extern int daemon(int nochdir, int noclose); |
| 50 | #endif /* HAVE_DAEMON */ |
| 51 | |
| 52 | #ifndef HAVE_STRSEP |
| 53 | extern char *strsep(char **stringp, const char *delim); |
| 54 | #endif /* HAVE_STRSEP */ |
| 55 | |
| 56 | #ifdef WINDOWS |
| 57 | |
| 58 | #define HAVE_STDIO_H /* mimic config.h */ |
| 59 | #define HAVE_STDARG_H |
| 60 | |
| 61 | #define atoll _atoi64 |
| 62 | #define fdatasync commit |
| 63 | #define __inline__ inline |
| 64 | #define __attribute__(X) /*nothing*/ |
| 65 | |
| 66 | #else /* !defined WINDOWS */ |
| 67 | |
| 68 | #ifndef O_BINARY |
| 69 | #define O_BINARY 0 /* unix is binary by default */ |
| 70 | #endif |
| 71 | |
| 72 | #endif /* defined WINDOWS */ |
| 73 | |
Xinyu Chen | 18b4feb | 2012-11-07 17:32:40 +0800 | [diff] [blame] | 74 | #ifdef __ANDROID__ |
| 75 | #define S_IREAD 0400 /* Read by owner. */ |
| 76 | #define S_IWRITE 0200 /* Write by owner. */ |
| 77 | #define S_IEXEC 0100 /* Execute by owner. */ |
| 78 | #endif |
| 79 | |
Steve Kondik | 2111ad7 | 2013-07-07 12:07:44 -0700 | [diff] [blame] | 80 | #endif /* defined _NTFS_COMPAT_H */ |
| 81 | |