From 71775351a71f085c76378f6450cb6279d72bc50b Mon Sep 17 00:00:00 2001 From: Andreas Fankhauser hiddenalpha.ch Date: Sat, 20 Aug 2022 17:52:36 +0200 Subject: Extract windoof kludge to dedicated compilation unit --- src/main/c/commonbase.h | 5 +---- src/main/c/zzKludge.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/main/c/zzKludge.c (limited to 'src') diff --git a/src/main/c/commonbase.h b/src/main/c/commonbase.h index 581bf54..f7a353e 100644 --- a/src/main/c/commonbase.h +++ b/src/main/c/commonbase.h @@ -21,10 +21,7 @@ #if WINDOOF -static inline void fixBrokenStdio( void ){ - _setmode(_fileno(stdin), O_BINARY); - _setmode(_fileno(stdout), O_BINARY); -} +void fixBrokenStdio( void ); #else # define fixBrokenStdio() #endif diff --git a/src/main/c/zzKludge.c b/src/main/c/zzKludge.c new file mode 100644 index 0000000..3d8ad5c --- /dev/null +++ b/src/main/c/zzKludge.c @@ -0,0 +1,15 @@ +#include "commonbase.h" + +#if WINDOOF + +#include +#include +#include + + +void fixBrokenStdio( void ){ + _setmode(_fileno(stdin), O_BINARY); + _setmode(_fileno(stdout), O_BINARY); +} + +#endif /* end WINDOOF */ -- cgit v1.1