From d527bc9132c2adf94666dc5b9593609d357ea1e4 Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Thu, 23 Sep 2021 19:39:13 -0400 Subject: Refactor Platform_CompareKernelVersion API --- darwin/PlatformHelpers.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'darwin/PlatformHelpers.h') diff --git a/darwin/PlatformHelpers.h b/darwin/PlatformHelpers.h index 25c5dcc0..f78ca4ea 100644 --- a/darwin/PlatformHelpers.h +++ b/darwin/PlatformHelpers.h @@ -11,18 +11,23 @@ in the source distribution for its full text. #include -struct kern { - short int version[3]; -}; +typedef struct KernelVersion { + short int major; + short int minor; + short int patch; +} KernelVersion; -void Platform_GetKernelVersion(struct kern* k); +void Platform_GetKernelVersion(KernelVersion* k); /* compare the given os version with the one installed returns: 0 if equals the installed version positive value if less than the installed version negative value if more than the installed version */ -int Platform_CompareKernelVersion(short int major, short int minor, short int component); +int Platform_CompareKernelVersion(KernelVersion v); + +// lowerBound <= currentVersion < upperBound +bool Platform_KernelVersionIsBetween(KernelVersion lowerBound, KernelVersion upperBound); double Platform_calculateNanosecondsPerMachTick(void); -- cgit v1.2.3