Whamcloud - gitweb
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 4ad09f1..13c2c20 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 228f439..656d3d9 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 e897bbb..6c0fd80 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