Get Engine Version in C++

// #if ENGINE_MAJOR_VERSION >= 4 && ENGINE_MINOR_VERSION >= 19 || ENGINE_MAJOR_VERSION == 5
// Is equal to
#if UE_VERSION_NEWER_THAN(4, 19, -1)
// but whole block can be reversed using UE_VERSION_OLDER_THAN macro
#if ENGINE_MAJOR_VERSION >= 4 && ENGINE_MINOR_VERSION >= 19 || ENGINE_MAJOR_VERSION == 5
    // Some Code for UE4.19 and newer versions
#else
    // Some code for pre UE4.19 versions
#endif
// will be equivalent to
#if UE_VERSION_OLDER_THAN(4, 19, 0)
    // Some code for pre UE4.19 versions
#else 
    // Some Code for UE4.19 and newer versions
#endif

#define ENGINE_MAJOR_VERSION 5 #define ENGINE_MINOR_VERSION 2 #define ENGINE_PATCH_VERSION 1

This means it’s version 5.2.1.

Reference

Last updated