# define abort __builtin_trap
# endif /* !_GL_INLINE_HEADER_BEGIN */
+/* gnulib doesn't build cleanly with older compilers. */
+# if __GNUC__ < 11
+_Pragma ("GCC diagnostic ignored \"-Wtype-limits\"")
+# endif
+
#endif
{
grub_uint8_t candidate_digest[GRUB_CRYPTODISK_MAX_KEYLEN];
grub_uint8_t digest[GRUB_CRYPTODISK_MAX_KEYLEN], salt[GRUB_CRYPTODISK_MAX_KEYLEN];
- grub_size_t saltlen = sizeof (salt), digestlen = sizeof (digest);
+ idx_t saltlen = sizeof (salt), digestlen = sizeof (digest);
const gcry_md_spec_t *hash;
gcry_err_code_t gcry_ret;
grub_uint8_t area_key[GRUB_CRYPTODISK_MAX_KEYLEN];
grub_uint8_t salt[GRUB_CRYPTODISK_MAX_KEYLEN];
grub_uint8_t *split_key = NULL;
- grub_size_t saltlen = sizeof (salt);
+ idx_t saltlen = sizeof (salt);
char cipher[32], *p;
const gcry_md_spec_t *hash;
gcry_err_code_t gcry_ret;
#define USHRT_MAX GRUB_USHRT_MAX
#define UINT_MAX GRUB_UINT_MAX
#define ULONG_MAX GRUB_ULONG_MAX
-#define SIZE_MAX GRUB_SIZE_MAX
+
+/* gnulib also defines this type */
+#ifndef SIZE_MAX
+# define SIZE_MAX GRUB_SIZE_MAX
+#endif
#define SCHAR_MIN GRUB_SCHAR_MIN
#define SCHAR_MAX GRUB_SCHAR_MAX
/* Does this compiler support compile-time error attributes? */
#if GNUC_PREREQ(4,3)
-# define ATTRIBUTE_ERROR(msg) \
+# define GRUB_ATTRIBUTE_ERROR(msg) \
__attribute__ ((__error__ (msg)))
#else
-# define ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn))
+# define GRUB_ATTRIBUTE_ERROR(msg) __attribute__ ((noreturn))
#endif
#if GNUC_PREREQ(4,4)
static inline void *
grub_bad_type_cast_real (int line, const char *file)
- ATTRIBUTE_ERROR ("bad type cast between incompatible grub types");
+ GRUB_ATTRIBUTE_ERROR ("bad type cast between incompatible grub types");
static inline void *
grub_bad_type_cast_real (int line, const char *file)