mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Mute clang 8 compilation error with gcc pragma
Move the pragma ignoring outside the function to fix the build with gcc. While here, add equivalent clang pragmas to mute the warning, as well. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
This commit is contained in:
parent
0d2f170048
commit
d4e392b54b
@ -40,17 +40,28 @@
|
||||
[2] https://github.com/mergeconflict/histogram
|
||||
*/
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wfloat-equal"
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
#endif
|
||||
|
||||
/** Compare two doubles for equality without the compiler warning. This is
|
||||
* probably the wrong thing to do, but this is just sample code :) */
|
||||
static inline int
|
||||
eq(double a, double b)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wfloat-equal"
|
||||
return a == b;
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
struct bin {
|
||||
double centroid;
|
||||
unsigned long count;
|
||||
|
Loading…
x
Reference in New Issue
Block a user