summaryrefslogtreecommitdiff
path: root/common/compat.h
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-07-08 18:27:54 +0000
committerStef Walter <stef@memberwebs.com>2004-07-08 18:27:54 +0000
commitc912dc0c7a6ab39c90200ed5614b181cd1397d5c (patch)
treea3b2df0f9a3a62ea9de95395d8e313bffddce203 /common/compat.h
parent0561cfd0ce346fce733dd1b25e5b2650e50bf7bf (diff)
Initial import
Diffstat (limited to 'common/compat.h')
-rw-r--r--common/compat.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/common/compat.h b/common/compat.h
new file mode 100644
index 0000000..6c20ae9
--- /dev/null
+++ b/common/compat.h
@@ -0,0 +1,51 @@
+
+
+#ifndef _COMPAT_H_
+#define _COMPAT_H_
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+
+#ifndef HAVE_STDARG_H
+#error ERROR: Must have a working stdarg.h header
+#else
+#include <stdarg.h>
+#endif
+
+#ifndef HAVE_REALLOCF
+void* reallocf(void* p, size_t sz);
+#endif
+
+#include <pthread.h>
+
+/* TODO: Move this logic to configure */
+#if HAVE_ERR_MUTEX == 1
+# define MUTEX_TYPE PTHREAD_MUTEX_ERRORCHECK_NP
+#else
+# if HAVE_ERR_MUTEX == 2
+# define MUTEX_TYPE PTHREAD_MUTEX_ERRORCHECK
+# else
+# error "Need error checking mutex functionality"
+# endif
+#endif
+
+#ifndef HAVE_STRLWR
+char* strlwr(char* s);
+#endif
+
+#ifndef HAVE_STRUPR
+char* strupr(char* s);
+#endif
+
+#ifndef HAVE_STRLCAT
+void strlcat(char *dst, const char *src, size_t size);
+#endif
+
+#ifndef HAVE_STRLCPY
+void strlcpy(char *dst, const char *src, size_t size);
+#endif
+
+#endif /* _COMPAT_H_ */