Created
February 10, 2025 16:58
-
-
Save Utshaw/df5db2c05b34c75c260b089e3da55abd to your computer and use it in GitHub Desktop.
Platform specific preprocessing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
#ifdef _WIN32 | |
std::cout << "Running on Windows" << std::endl; | |
#elif __APPLE__ | |
std::cout << "Running on macOS" << std::endl; | |
#elif __linux__ | |
std::cout << "Running on Linux" << std::endl; | |
#else | |
std::cout << "Unknown Operating System" << std::endl; | |
#endif | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment