Check if compiler is Turbo C++
13:37 12 Nov 2016

I am currently dealing with legacy code designed for Turbo C++. To work around Turbo C++'s lack of a bool data type, the program contains the following line of code.

// Necessary when compiling with Turbo C++
enum bool {false, true};

Most C++ compilers fail to run the program with error: expected identifier before 'bool'. While I would love to switch to a more recent compiler, I am unfortunately required to maintain this workaround for backwards compatibility.

How can I indicate that this specific line of code should only compile in Turbo C++?

c++ turbo-c++ predefined-macro