summaryrefslogtreecommitdiff
path: root/include/ntfs-3g/compat.h (plain)
blob: d66205937cf092aa6b68fad58dcd7b62711bedb1
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#ifndef PATH_MAX
35#define PATH_MAX 4096
36#endif
37
38#ifndef HAVE_FFS
39extern int ffs(int i);
40#endif /* HAVE_FFS */
41
42#ifndef HAVE_DAEMON
43extern int daemon(int nochdir, int noclose);
44#endif /* HAVE_DAEMON */
45
46#ifndef HAVE_STRSEP
47extern char *strsep(char **stringp, const char *delim);
48#endif /* HAVE_STRSEP */
49
50#ifdef WINDOWS
51
52#define HAVE_STDIO_H /* mimic config.h */
53#define HAVE_STDARG_H
54
55#define atoll _atoi64
56#define fdatasync commit
57#define __inline__ inline
58#define __attribute__(X) /*nothing*/
59
60#else /* !defined WINDOWS */
61
62#ifndef O_BINARY
63#define O_BINARY 0 /* unix is binary by default */
64#endif
65
66#endif /* defined WINDOWS */
67
68#endif /* defined _NTFS_COMPAT_H */
69
70