summaryrefslogtreecommitdiff
path: root/include/global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/global.h')
-rw-r--r--include/global.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index 8e41045d1aa8a..e0a1c31135b92 100644
--- a/include/global.h
+++ b/include/global.h
@@ -15,3 +15,23 @@
#else
# define n_wcscpy(dst, src, size ) wcscpy(dst, src)
#endif
+
+#define min(x,y) ((x) < (y) ? (x) : (y))
+#define max(x,y) ((x) > (y) ? (x) : (y))
+#define prefix(str, pfx) (strncmp(pfx, str, strlen(pfx)) == 0)
+
+#undef __unused
+#define __unused __attribute__((unused))
+
+#ifdef __GLIBC__
+#ifdef _IO_getc_unlocked
+#undef getc
+#define getc(f) _IO_getc_unlocked(f)
+#endif
+#ifdef _IO_putc_unlocked
+#undef putc
+#undef putchar
+#define putc(c, f) _IO_putc_unlocked(c, f)
+#define putchar(c) _IO_putc_unlocked(c, stdout)
+#endif
+#endif