1 /* Generated by ./xlat/gen.sh from ./xlat/ioprio_class.in; do not edit. */ 2 3 #include "gcc_compat.h" 4 #include "static_assert.h" 5 6 #if defined(IOPRIO_CLASS_NONE) || (defined(HAVE_DECL_IOPRIO_CLASS_NONE) && HAVE_DECL_IOPRIO_CLASS_NONE) 7 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 8 static_assert((IOPRIO_CLASS_NONE) == (0), "IOPRIO_CLASS_NONE != 0"); 9 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 10 #else 11 # define IOPRIO_CLASS_NONE 0 12 #endif 13 #if defined(IOPRIO_CLASS_RT) || (defined(HAVE_DECL_IOPRIO_CLASS_RT) && HAVE_DECL_IOPRIO_CLASS_RT) 14 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 15 static_assert((IOPRIO_CLASS_RT) == (1), "IOPRIO_CLASS_RT != 1"); 16 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 17 #else 18 # define IOPRIO_CLASS_RT 1 19 #endif 20 #if defined(IOPRIO_CLASS_BE) || (defined(HAVE_DECL_IOPRIO_CLASS_BE) && HAVE_DECL_IOPRIO_CLASS_BE) 21 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 22 static_assert((IOPRIO_CLASS_BE) == (2), "IOPRIO_CLASS_BE != 2"); 23 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 24 #else 25 # define IOPRIO_CLASS_BE 2 26 #endif 27 #if defined(IOPRIO_CLASS_IDLE) || (defined(HAVE_DECL_IOPRIO_CLASS_IDLE) && HAVE_DECL_IOPRIO_CLASS_IDLE) 28 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE 29 static_assert((IOPRIO_CLASS_IDLE) == (3), "IOPRIO_CLASS_IDLE != 3"); 30 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE 31 #else 32 # define IOPRIO_CLASS_IDLE 3 33 #endif 34 35 #ifndef XLAT_MACROS_ONLY 36 37 # ifdef IN_MPERS 38 39 # error static const struct xlat ioprio_class in mpers mode 40 41 # else 42 43 static 44 const struct xlat ioprio_class[] = { 45 XLAT(IOPRIO_CLASS_NONE), 46 XLAT(IOPRIO_CLASS_RT), 47 XLAT(IOPRIO_CLASS_BE), 48 XLAT(IOPRIO_CLASS_IDLE), 49 XLAT_END 50 }; 51 52 # endif /* !IN_MPERS */ 53 54 #endif /* !XLAT_MACROS_ONLY */ 55