From de3ec9ae412a244ec814eadd92fdfe071545435e Mon Sep 17 00:00:00 2001 From: yasuoka Date: Wed, 16 Jul 2025 00:36:36 +0000 Subject: [PATCH] Fix games/enigma to keep it compilable after forthcoming stdio opaque diffs. Substituting a FILE object for std{out,err} will be impossible. ok sthen --- games/enigma/Makefile | 2 +- games/enigma/patches/patch-src_main_cc | 29 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 games/enigma/patches/patch-src_main_cc diff --git a/games/enigma/Makefile b/games/enigma/Makefile index 11fe779c0de..667ab27b1cf 100644 --- a/games/enigma/Makefile +++ b/games/enigma/Makefile @@ -3,7 +3,7 @@ COMMENT= Oxyd/Rock'n'Roll clone V= 1.30 PKGNAME= enigma-${V} DISTNAME= Enigma-${V} -REVISION= 0 +REVISION= 1 CATEGORIES= games x11 diff --git a/games/enigma/patches/patch-src_main_cc b/games/enigma/patches/patch-src_main_cc new file mode 100644 index 00000000000..77f13430907 --- /dev/null +++ b/games/enigma/patches/patch-src_main_cc @@ -0,0 +1,29 @@ +Index: src/main.cc +--- src/main.cc.orig ++++ src/main.cc +@@ -313,21 +313,25 @@ void Application::init(int argc, char **argv) + if (ap.redirect) { + FILE *newfp; + newfp = std::freopen((userStdPath + "/Output.log").c_str(), "w", stdout); ++#if 0 /* can't substitute a FILE object for stdout if FILE is an opaque. */ + if ( newfp == NULL ) { // This happens on NT + newfp = fopen((userStdPath + "/Output.log").c_str(), "w"); + if (newfp) { // in case stdout is a macro + *stdout = *newfp; + } + } ++#endif + setvbuf(stdout, NULL, _IOLBF, BUFSIZ); // Line buffered + + newfp = std::freopen((userStdPath + "/Error.log").c_str(), "w", stderr); ++#if 0 /* can't substitute a FILE object for stdout if FILE is an opaque. */ + if ( newfp == NULL ) { // This happens on NT + newfp = fopen((userStdPath + "/Error.log").c_str(), "w"); + if (newfp) { // in case stderr is a macro + *stderr = *newfp; + } + } ++#endif + setbuf(stderr, NULL); // No buffering + } +