1 /* Generated by ./xlat/gen.sh from ./xlat/open_access_modes.in; do not edit. */
2 
3 #include "gcc_compat.h"
4 #include "static_assert.h"
5 
6 #if defined(O_RDONLY) || (defined(HAVE_DECL_O_RDONLY) && HAVE_DECL_O_RDONLY)
7 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
8 static_assert((O_RDONLY) == (0), "O_RDONLY != 0");
9 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
10 #else
11 # define O_RDONLY 0
12 #endif
13 #if defined(O_WRONLY) || (defined(HAVE_DECL_O_WRONLY) && HAVE_DECL_O_WRONLY)
14 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
15 static_assert((O_WRONLY) == (1), "O_WRONLY != 1");
16 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
17 #else
18 # define O_WRONLY 1
19 #endif
20 #if defined(O_RDWR) || (defined(HAVE_DECL_O_RDWR) && HAVE_DECL_O_RDWR)
21 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
22 static_assert((O_RDWR) == (2), "O_RDWR != 2");
23 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
24 #else
25 # define O_RDWR 2
26 #endif
27 #if defined(O_ACCMODE) || (defined(HAVE_DECL_O_ACCMODE) && HAVE_DECL_O_ACCMODE)
28 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
29 static_assert((O_ACCMODE) == (3), "O_ACCMODE != 3");
30 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
31 #else
32 # define O_ACCMODE 3
33 #endif
34 
35 #ifndef XLAT_MACROS_ONLY
36 
37 # ifndef IN_MPERS
38 
39 const struct xlat open_access_modes[] = {
40  [O_RDONLY] = XLAT(O_RDONLY),
41  [O_WRONLY] = XLAT(O_WRONLY),
42  [O_RDWR] = XLAT(O_RDWR),
43  [O_ACCMODE] = XLAT(O_ACCMODE),
44  XLAT_END
45 };
46 
47 # endif /* !IN_MPERS */
48 
49 #endif /* !XLAT_MACROS_ONLY */
50