I have a very large application created using Visual Studio 2008 that is designed to work on Windows XP. The code consists of a single solution file that contains six separate projects. My task is to port this application to Linux. I haven’t done anything before.
Yesterday, I discovered that my company wants this code to still compile on Windows as soon as I finish it. My first idea for this is to use a preprocessor instruction, for example:
#define COMPILE_FOR_LINUX
Then I could tell the compiler which files to include in the headers using preprocessor blocks such as:
#ifdef COMPILE_FOR_LINUX
#else
#endif
After including the appropriate files, I could encapsulate all the platform-dependent code with the following blocks:
#ifdef COMPILE_FOR_LINUX
#else
#endif
, COMPILE_FOR_LINUX, . , .
, , , Visual Studio, . Linux , COMPILE_FOR_LINUX, makefile . , , , , .
- - , ?