summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src/src/defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libmdbx/src/src/defs.h')
-rw-r--r--libs/libmdbx/src/src/defs.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/libmdbx/src/src/defs.h b/libs/libmdbx/src/src/defs.h
index 024322a1f2..a672b8bdf0 100644
--- a/libs/libmdbx/src/src/defs.h
+++ b/libs/libmdbx/src/src/defs.h
@@ -303,7 +303,7 @@
#endif /* __flatten */
#ifndef likely
-# if defined(__GNUC__) || defined(__clang__)
+# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
# define likely(cond) __builtin_expect(!!(cond), 1)
# else
# define likely(x) (x)
@@ -311,13 +311,24 @@
#endif /* likely */
#ifndef unlikely
-# if defined(__GNUC__) || defined(__clang__)
+# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
# define unlikely(cond) __builtin_expect(!!(cond), 0)
# else
# define unlikely(x) (x)
# endif
#endif /* unlikely */
+/* Workaround for Coverity Scan */
+#if defined(__COVERITY__) && __GNUC_PREREQ(7, 0) && !defined(__cplusplus)
+typedef float _Float32;
+typedef double _Float32x;
+typedef double _Float64;
+typedef long double _Float64x;
+typedef float _Float128 __attribute__((__mode__(__TF__)));
+typedef __complex__ float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
+#endif /* Workaround for Coverity Scan */
+
/* Wrapper around __func__, which is a C99 feature */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
# define mdbx_func_ __func__