This generally works, but can make problem again if your later code calls some UE functions which use “original” check
macro.
Better solution is to use #pragma push_macro
/#pragma pop_macro
. AFAIK this is supported by all big-three compilers (GCC,Clang,MSVC).
#include "some_unreal_header.h"
#pragma push_macro("check") // store 'check' macro current definition
#undef check // undef to avoid conflicts
#include "some_3rd_party_lib.h"
#pragma pop_macro("check") // restore definition