Еще вопрос по типу ОС. Я знаю, я могу это сделать:
Код: Выделить всё
#if defined(__linux__)
/* Linux. --------------------------------------------------- */
#endif
Код: Выделить всё
#include
int compiler()
{
#if defined (__GNUC__)
return 0;
#elif defined (_MSC_VER)
return 1;
#else
return -1;
#endif;
}
int os()
{
#if defined(_WIN32) || defined(_WIN64)
return 0;
#elif defined(__linux__)
return 1;
#else
return -1;
#endif
}
int main(int argc, char **argv)
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/17208967/detect-os-type-compiler-with-elegant-c-c-code-especially-gcc-g[/url]
Мобильная версия