mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
AK: Add CLOCK_*_COARSE aliases for darwin and BSD variants
The coarse clocks in time.h are a linux extension that we've adopted. MacOS and the BSDs don't have it, so we need an alias in a platform header for Lagom builds.
This commit is contained in:
parent
3bdaba0b28
commit
1219c65249
Notes:
sideshowbarker
2024-07-19 00:29:32 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/1219c652490 Pull-request: https://github.com/SerenityOS/serenity/pull/4582 Issue: https://github.com/SerenityOS/serenity/issues/4418 Issue: https://github.com/SerenityOS/serenity/issues/4483 Issue: https://github.com/SerenityOS/serenity/issues/4569
@ -34,6 +34,15 @@
|
||||
# define AK_ARCH_X86_64 1
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
# define AK_OS_MACOS
|
||||
# define AK_OS_BSD_GENERIC
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||
# define AK_OS_BSD_GENERIC
|
||||
#endif
|
||||
|
||||
#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch)
|
||||
|
||||
#ifdef ALWAYS_INLINE
|
||||
@ -88,4 +97,9 @@ ALWAYS_INLINE int count_trailing_zeroes_32(unsigned int val)
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#ifdef AK_OS_BSD_GENERIC
|
||||
# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
|
||||
# define CLOCK_REALTIME_COARSE CLOCK_REALTIME
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user