Avoid some "gcc -pedantic" warnings.
[gnulib.git] / lib / fcntl.in.h
1 /* Like <fcntl.h>, but with non-working flags defined to 0.
2
3    Copyright (C) 2006-2008 Free Software Foundation, Inc.
4
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 3 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
18 /* written by Paul Eggert */
19
20 #ifndef _GL_FCNTL_H
21
22 @PRAGMA_SYSTEM_HEADER@
23
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 #include <unistd.h>
27 /* The include_next requires a split double-inclusion guard.  */
28 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
29
30 #ifndef _GL_FCNTL_H
31 #define _GL_FCNTL_H
32
33
34 /* Declare overridden functions.  */
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #if (@GNULIB_OPEN@ && @REPLACE_OPEN@) || defined FCHDIR_REPLACEMENT
41 # define open rpl_open
42 extern int open (const char *filename, int flags, ...);
43 #endif
44
45 #ifdef __cplusplus
46 }
47 #endif
48
49
50 /* Fix up the O_* macros.  */
51
52 #if !defined O_DIRECT && defined O_DIRECTIO
53 /* Tru64 spells it `O_DIRECTIO'.  */
54 # define O_DIRECT O_DIRECTIO
55 #endif
56
57 #ifndef O_DIRECT
58 # define O_DIRECT 0
59 #endif
60
61 #ifndef O_DIRECTORY
62 # define O_DIRECTORY 0
63 #endif
64
65 #ifndef O_DSYNC
66 # define O_DSYNC 0
67 #endif
68
69 #ifndef O_NDELAY
70 # define O_NDELAY 0
71 #endif
72
73 #ifndef O_NOATIME
74 # define O_NOATIME 0
75 #endif
76
77 #ifndef O_NONBLOCK
78 # define O_NONBLOCK O_NDELAY
79 #endif
80
81 #ifndef O_NOCTTY
82 # define O_NOCTTY 0
83 #endif
84
85 #ifndef O_NOFOLLOW
86 # define O_NOFOLLOW 0
87 #endif
88
89 #ifndef O_NOLINKS
90 # define O_NOLINKS 0
91 #endif
92
93 #ifndef O_RSYNC
94 # define O_RSYNC 0
95 #endif
96
97 #ifndef O_SYNC
98 # define O_SYNC 0
99 #endif
100
101 /* For systems that distinguish between text and binary I/O.
102    O_BINARY is usually declared in fcntl.h  */
103 #if !defined O_BINARY && defined _O_BINARY
104   /* For MSC-compatible compilers.  */
105 # define O_BINARY _O_BINARY
106 # define O_TEXT _O_TEXT
107 #endif
108
109 #ifdef __BEOS__
110   /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
111 # undef O_BINARY
112 # undef O_TEXT
113 #endif
114
115 #ifndef O_BINARY
116 # define O_BINARY 0
117 # define O_TEXT 0
118 #endif
119
120
121 #endif /* _GL_FCNTL_H */
122 #endif /* _GL_FCNTL_H */