]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Define __GNUC_PREREQ if necessary
authorTheodore Ts'o <tytso@mit.edu>
Thu, 11 Oct 2018 02:25:54 +0000 (22:25 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 11 Oct 2018 02:25:54 +0000 (22:25 -0400)
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 <tytso@mit.edu>
lib/ext2fs/ext2_fs.h
lib/ext2fs/hashmap.h
lib/uuid/uuidP.h

index 4ad09f1468dac9b43399fdda42f323353e0ecb36..13c2c20e5c429b1e409af771f6d7163b433a6780 100644 (file)
 
 #include <ext2fs/ext2_types.h>         /* 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
  */
index 228f4395270a07f0452025b3e1dfbec3ec36782f..656d3d9048d90ed026b8c0016434a688848ea950 100644 (file)
@@ -4,6 +4,15 @@
 # include <stdlib.h>
 # include <stdint.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
+
 struct ext2fs_hashmap {
        uint32_t size;
        uint32_t(*hash)(const void *key, size_t len);
index e897bbb4e59c587edde8eb179c67129a7582def8..6c0fd80a46fd4ab09ea6fd06d4f3a9c18d4f6208 100644 (file)
@@ -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