Skip to content

Instantly share code, notes, and snippets.

@Utshaw
Created February 10, 2025 16:58
Show Gist options
  • Save Utshaw/df5db2c05b34c75c260b089e3da55abd to your computer and use it in GitHub Desktop.
Save Utshaw/df5db2c05b34c75c260b089e3da55abd to your computer and use it in GitHub Desktop.
Platform specific preprocessing
#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