mirror of
https://github.com/isar/libmdbx.git
synced 2025-02-02 06:08:21 +08:00
mdbx: workaround for Coverity Scan.
Change-Id: I0e2d22bbbd38ac7978fb8879219ded79a5be1b0a
This commit is contained in:
parent
870c2a6f9c
commit
b443477869
15
src/defs.h
15
src/defs.h
@ -303,7 +303,7 @@
|
|||||||
#endif /* __flatten */
|
#endif /* __flatten */
|
||||||
|
|
||||||
#ifndef likely
|
#ifndef likely
|
||||||
# if defined(__GNUC__) || defined(__clang__)
|
# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
|
||||||
# define likely(cond) __builtin_expect(!!(cond), 1)
|
# define likely(cond) __builtin_expect(!!(cond), 1)
|
||||||
# else
|
# else
|
||||||
# define likely(x) (x)
|
# define likely(x) (x)
|
||||||
@ -311,13 +311,24 @@
|
|||||||
#endif /* likely */
|
#endif /* likely */
|
||||||
|
|
||||||
#ifndef unlikely
|
#ifndef unlikely
|
||||||
# if defined(__GNUC__) || defined(__clang__)
|
# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
|
||||||
# define unlikely(cond) __builtin_expect(!!(cond), 0)
|
# define unlikely(cond) __builtin_expect(!!(cond), 0)
|
||||||
# else
|
# else
|
||||||
# define unlikely(x) (x)
|
# define unlikely(x) (x)
|
||||||
# endif
|
# endif
|
||||||
#endif /* unlikely */
|
#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 */
|
/* Wrapper around __func__, which is a C99 feature */
|
||||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||||
# define mdbx_func_ __func__
|
# define mdbx_func_ __func__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user