From: Theodore Ts'o Date: Thu, 11 Oct 2018 02:25:54 +0000 (-0400) Subject: Define __GNUC_PREREQ if necessary X-Git-Tag: v1.44.5~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98c6113b414782eb5bfcb67c33d09950ed203f20;p=thirdparty%2Fe2fsprogs.git Define __GNUC_PREREQ if necessary The __GNUC_PREREQ convenience macro is defined by glibc's header files. If it isn't available, make it available for us to use. Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index 4ad09f146..13c2c20e5 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -18,6 +18,15 @@ #include /* Changed from linux/types.h */ +#ifndef __GNUC_PREREQ +#if defined(__GNUC__) && defined(__GNUC_MINOR__) +#define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +#define __GNUC_PREREQ(maj, min) 0 +#endif +#endif + /* * The second extended filesystem constants/structures */ diff --git a/lib/ext2fs/hashmap.h b/lib/ext2fs/hashmap.h index 228f43952..656d3d904 100644 --- a/lib/ext2fs/hashmap.h +++ b/lib/ext2fs/hashmap.h @@ -4,6 +4,15 @@ # include # include +#ifndef __GNUC_PREREQ +#if defined(__GNUC__) && defined(__GNUC_MINOR__) +#define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +#define __GNUC_PREREQ(maj, min) 0 +#endif +#endif + struct ext2fs_hashmap { uint32_t size; uint32_t(*hash)(const void *key, size_t len); diff --git a/lib/uuid/uuidP.h b/lib/uuid/uuidP.h index e897bbb4e..6c0fd80a4 100644 --- a/lib/uuid/uuidP.h +++ b/lib/uuid/uuidP.h @@ -55,6 +55,14 @@ struct uuid { uint8_t node[6]; }; +#ifndef __GNUC_PREREQ +#if defined(__GNUC__) && defined(__GNUC_MINOR__) +#define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +#define __GNUC_PREREQ(maj, min) 0 +#endif +#endif /* * prototypes