mdbx: workaround for Coverity Scan.

Change-Id: I0e2d22bbbd38ac7978fb8879219ded79a5be1b0a
This commit is contained in:
Leonid Yuriev 2019-05-28 21:19:54 +03:00
parent 870c2a6f9c
commit b443477869

View File

@ -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__