Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
EngineVersionComparison.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Runtime/Launch/Resources/Version.h"
6
7// Helper for UE_VERSION_NEWER_THAN and UE_VERSION_OLDER_THAN
8#define UE_GREATER_SORT(Value, ValueToBeGreaterThan, TieBreaker)
9 (((Value) > (ValueToBeGreaterThan)) || (((Value) == (ValueToBeGreaterThan)) && (TieBreaker)))
10
11// Version comparison macro that is defined to true if the UE version is newer than MajorVer.MinorVer.PatchVer and false otherwise
12// (a typical use is to alert integrators to revisit this code when upgrading to a new engine version)
13#define UE_VERSION_NEWER_THAN(MajorVersion, MinorVersion, PatchVersion)
14 UE_GREATER_SORT(ENGINE_MAJOR_VERSION, MajorVersion, UE_GREATER_SORT(ENGINE_MINOR_VERSION, MinorVersion, UE_GREATER_SORT(ENGINE_PATCH_VERSION, PatchVersion, false)))
15
16// Version comparison macro that is defined to true if the UE version is older than MajorVer.MinorVer.PatchVer and false otherwise
17// (use when making code that needs to be compatible with older engine versions)
18#define UE_VERSION_OLDER_THAN(MajorVersion, MinorVersion, PatchVersion)
19 UE_GREATER_SORT(MajorVersion, ENGINE_MAJOR_VERSION, UE_GREATER_SORT(MinorVersion, ENGINE_MINOR_VERSION, UE_GREATER_SORT(PatchVersion, ENGINE_PATCH_VERSION, false)))
#define UE_GREATER_SORT(Value, ValueToBeGreaterThan, TieBreaker)