mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 09:25:22 +02:00
FROMLIST: selftests/timers: Guard LONG_MAX / LONG_MIN defines
Add ifndef guards around LONG_MAX / LONG_MIN defines. When building with Android bionic, these macros are redefined because bionic's time.h will include linux/time.h, which includes limit.h. INFO: From Compiling common/tools/testing/selftests/timers/valid-adjtimex.c: common/tools/testing/selftests/timers/valid-adjtimex.c:107:9: warning: 'LONG_MAX' macro redefined [-Wmacro-redefined] 107 | #define LONG_MAX (~0UL>>1) | ^ prebuilts/clang/host/linux-x86/clang-r522817/lib/clang/18/include/limits.h:47:9: note: previous definition is here 47 | #define LONG_MAX __LONG_MAX__ | ^ common/tools/testing/selftests/timers/valid-adjtimex.c:108:9: warning: 'LONG_MIN' macro redefined [-Wmacro-redefined] 108 | #define LONG_MIN (-LONG_MAX - 1) | ^ prebuilts/clang/host/linux-x86/clang-r522817/lib/clang/18/include/limits.h:52:9: note: previous definition is here 52 | #define LONG_MIN (-__LONG_MAX__ -1L) | ^ Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Edward Liaw <edliaw@google.com> Bug: 339526723 Link: https://lore.kernel.org/linux-kselftest/20240604231219.444603-1-edliaw@google.com/ Signed-off-by: Edward Liaw <edliaw@google.com> (cherry picked from https://android-review.googlesource.com/q/commit:08172af5a61080c0b5fc2fea13611dd04697ef93) Merged-In: Ia2e96dfbc6ae508330569359a7bbeb53e0131116 Change-Id: Ia2e96dfbc6ae508330569359a7bbeb53e0131116
This commit is contained in:
parent
4141052d20
commit
069482893b
|
@ -102,8 +102,12 @@ long outofrange_freq[NUM_FREQ_OUTOFRANGE] = {
|
|||
1000 * SHIFTED_PPM,
|
||||
};
|
||||
|
||||
#ifndef LONG_MAX
|
||||
#define LONG_MAX (~0UL>>1)
|
||||
#endif
|
||||
#ifndef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1)
|
||||
#endif
|
||||
|
||||
long invalid_freq[NUM_FREQ_INVALID] = {
|
||||
LONG_MAX,
|
||||
|
|
Loading…
Reference in New Issue
Block a user