Is there Unreal Egnine version macro definition?

For some reason, I have to make my project runs for both UE 4.11 and UE 4.12.

I’m looking for some version macro for UE4, like UE_VERSION listed below.

void Attach(USceneComponent* component, USceneComponent* parent)
{
#if UE_VERSION == 41100
	component->AttachTo(parent); // UE 4.11
#elif UE_VERSION == 41200
	component->AttachToComponent(parent, FAttachmentTransformRules::KeepRelativeTransform); // UE 4.12
#endif
}

Is there any macro define in UE4 that I can use?

Yes, in Version.h you have ENGINE_MAJOR_VERSION, ENGINE_MINOR_VERSION and ENGINE_PATCH_VERSION.

Franco

I had to use this line:
#include “Runtime/Launch/Resources/Version.h”