summaryrefslogtreecommitdiff
path: root/src/main/c/commonbase.h
diff options
context:
space:
mode:
authorAndreas Fankhauser (@tux-six)2022-07-07 02:40:50 +0200
committerAndreas Fankhauser (@tux-six)2022-07-07 02:42:44 +0200
commit8715622ee3a0c0daa74934e5a349bd47c7fd23bd (patch)
treee28a7ecf6674eb168c14a0c3292a318083fdc9df /src/main/c/commonbase.h
parentc8cae553fb0058e7defef83669c8ac572e7f0d99 (diff)
downloadDeflateAndInflate-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.h31
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
+