Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47df7e38 authored by Jaesoo Lee's avatar Jaesoo Lee
Browse files

fixed bug undefining LIKELY/UNLIKELY in math lib

Bug: 36275627
Test: Built and check the surfaceflinger compiled

Change-Id: I062b8c0db540443635ac746824edb295190235d0
parent 52cf6370
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@

#include  <utils/String8.h>

#ifndef LIKELY
#define LIKELY_DEFINED_LOCAL
#ifdef __cplusplus
#   define LIKELY( exp )    (__builtin_expect( !!(exp), true ))
#   define UNLIKELY( exp )  (__builtin_expect( !!(exp), false ))
@@ -37,6 +39,7 @@
#   define LIKELY( exp )    (__builtin_expect( !!(exp), 1 ))
#   define UNLIKELY( exp )  (__builtin_expect( !!(exp), 0 ))
#endif
#endif

#define PURE __attribute__((pure))

@@ -631,7 +634,11 @@ public:
}  // namespace details
}  // namespace android

#ifdef LIKELY_DEFINED_LOCAL
#undef LIKELY_DEFINED_LOCAL
#undef LIKELY
#undef UNLIKELY
#endif //LIKELY_DEFINED_LOCAL

#undef PURE
#undef CONSTEXPR
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <type_traits>

#ifndef LIKELY
#define LIKELY_DEFINED_LOCAL
#ifdef __cplusplus
#   define LIKELY( exp )    (__builtin_expect( !!(exp), true ))
#   define UNLIKELY( exp )  (__builtin_expect( !!(exp), false ))
@@ -202,6 +203,10 @@ public:

} // namespace std

#ifdef LIKELY_DEFINED_LOCAL
#undef LIKELY_DEFINED_LOCAL
#undef LIKELY
#undef UNLIKELY
#endif // LIKELY_DEFINED_LOCAL

#undef CONSTEXPR