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 ELIBBAD 41 #define ELIBBAD ENOEXEC 42 #endif 43 44 #ifndef PATH_MAX 45 #define PATH_MAX 4096 46 #endif 47 48 #ifndef HAVE_FFS 49 extern int ffs(int i); 50 #endif /* HAVE_FFS */ 51 52 #ifndef HAVE_DAEMON 53 extern int daemon(int nochdir, int noclose); 54 #endif /* HAVE_DAEMON */ 55 56 #ifndef HAVE_STRSEP 57 extern char *strsep(char **stringp, const char *delim); 58 #endif /* HAVE_STRSEP */ 59 60 #ifdef WINDOWS 61 62 #define HAVE_STDIO_H /* mimic config.h */ 63 #define HAVE_STDARG_H 64 65 #define atoll _atoi64 66 #define fdatasync commit 67 #define __inline__ inline 68 #define __attribute__(X) /*nothing*/ 69 70 #else /* !defined WINDOWS */ 71 72 #ifndef O_BINARY 73 #define O_BINARY 0 /* unix is binary by default */ 74 #endif 75 76 #endif /* defined WINDOWS */ 77 78 #endif /* defined _NTFS_COMPAT_H */ 79 80