Fixed a constant string concatenation
[ntfs-3g.git] / include / ntfs-3g / compat.h
blob288a86a2bdcbfde48545755e94767e42aa8740e7
1 /*
2 * compat.h - Tweaks for compatibility with non-Linux systems.
4 * Copyright (c) 2002 Richard Russon
5 * Copyright (c) 2002-2004 Anton Altaparmakov
6 * Copyright (c) 2008-2009 Szabolcs Szakacsits
7 * Copyright (c) 2019 Jean-Pierre Andre
9 * This program/include file is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as published
11 * by the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program/include file is distributed in the hope that it will be
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
16 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program (in the main directory of the NTFS-3G
21 * distribution in the file COPYING); if not, write to the Free Software
22 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef _NTFS_COMPAT_H
26 #define _NTFS_COMPAT_H
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31 #ifdef HAVE_SYS_PARAM_H
32 #include <sys/param.h>
33 #endif
35 #include <errno.h> /* ENODATA */
37 #ifndef ENODATA
38 #define ENODATA ENOENT
39 #endif
41 #ifndef ELIBBAD
42 #define ELIBBAD ENOEXEC
43 #endif
45 #ifndef ELIBACC
46 #define ELIBACC ENOENT
47 #endif
49 /* xattr APIs in macOS differs from Linux ones in that they expect the special
50 * error code ENOATTR to be returned when an attribute cannot be found. So
51 * define NTFS_NOXATTR_ERRNO to the appropriate "no xattr found" errno value for
52 * the platform. */
53 #if defined(__APPLE__) || defined(__DARWIN__)
54 #define NTFS_NOXATTR_ERRNO ENOATTR
55 #else
56 #define NTFS_NOXATTR_ERRNO ENODATA
57 #endif
59 #ifndef PATH_MAX
60 #define PATH_MAX 4096
61 #endif
63 #ifndef HAVE_FFS
64 extern int ffs(int i);
65 #endif /* HAVE_FFS */
67 #ifndef HAVE_DAEMON
68 extern int daemon(int nochdir, int noclose);
69 #endif /* HAVE_DAEMON */
71 #ifndef HAVE_STRSEP
72 extern char *strsep(char **stringp, const char *delim);
73 #endif /* HAVE_STRSEP */
75 #ifdef WINDOWS
77 #define HAVE_STDIO_H /* mimic config.h */
78 #define HAVE_STDARG_H
80 #define atoll _atoi64
81 #define fdatasync commit
82 #define __inline__ inline
83 #define __attribute__(X) /*nothing*/
85 #else /* !defined WINDOWS */
87 #ifndef O_BINARY
88 #define O_BINARY 0 /* unix is binary by default */
89 #endif
91 #endif /* defined WINDOWS */
93 #endif /* defined _NTFS_COMPAT_H */