diff options
author | Andreas Fankhauser (@tux-six) | 2022-07-07 02:40:50 +0200 |
---|---|---|
committer | Andreas Fankhauser (@tux-six) | 2022-07-07 02:42:44 +0200 |
commit | 8715622ee3a0c0daa74934e5a349bd47c7fd23bd (patch) | |
tree | e28a7ecf6674eb168c14a0c3292a318083fdc9df /src/main/c/commonbase.h | |
parent | c8cae553fb0058e7defef83669c8ac572e7f0d99 (diff) | |
download | DeflateAndInflate-8715622ee3a0c0daa74934e5a349bd47c7fd23bd.zip DeflateAndInflate-8715622ee3a0c0daa74934e5a349bd47c7fd23bd.tar.gz |
Cleanup, setup 'configure', add contrib Dockerfile for simpler build
Diffstat (limited to 'src/main/c/commonbase.h')
-rw-r--r-- | src/main/c/commonbase.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/main/c/commonbase.h b/src/main/c/commonbase.h new file mode 100644 index 0000000..581bf54 --- /dev/null +++ b/src/main/c/commonbase.h @@ -0,0 +1,31 @@ + +/* common config. Stuff like feature-test-macros for example */ + +#define _POSIX_C_SOURCE 200809L + +#define STR_QUOT_IAHGEWIH(s) #s +#define STR_QUOT(s) STR_QUOT_IAHGEWIH(s) + +#define STR_CAT(a, b) a ## b + +#ifndef likely +# define likely(a) (a) +#endif +#ifndef unlikely +# define unlikely(a) (a) +#endif + +#ifdef _WIN32 +# define WINDOOF 1 +#endif + + +#if WINDOOF +static inline void fixBrokenStdio( void ){ + _setmode(_fileno(stdin), O_BINARY); + _setmode(_fileno(stdout), O_BINARY); +} +#else +# define fixBrokenStdio() +#endif + |