Check out example codes for "how to get os name in c++". It will help you in understanding the concepts better.

Code Example 1

#include <stdio.h>

#if defined(_WIN32) || defined(_WIN64)
        const char* os = "Windows";
#else
#ifdef __linux
        const char* os = "Linux";
#else
        const char* os = "Unknown";
#endif
#endif

int main(void)
{
   printf("os = %s\n", os);
   return 0;
}

Learn ReactJs, React Native from akashmittal.com