-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Add pragmas to account for the differences in compiling using the Emscripten pipeline.
`#include
#ifndef EMSCRIPTEN
#include
#endif
int main() {
std::cout << "Running on ";
#ifdef EMSCRIPTEN
std::cout << "Emscripten (WebAssembly)";
#else
std::cout << "Native platform";
// File system operations only if not Emscripten
std::ofstream file("example.txt");
if (file.is_open()) {
file << "This is a test file.\n";
file.close();
std::cout << " - File system access available.";
} else {
std::cout << " - Failed to write to file.";
}
#endif
std::cout << std::endl;
return 0;
}`
Metadata
Metadata
Assignees
Labels
No labels