From f3b412fbd6dd94d64eb6a63d88baef2816891c29 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 23 Sep 2005 00:38:22 +0000 Subject: r10438: Move portability functions to lib/replace/; replace now simply ensures that a given set of (working) POSIX functions are available (without prefixes to their names, etc). See lib/replace/README for a list. Functions that behave different from their POSIX specification (such as sys_select, sys_read, etc) have kept the sys_ prefix. (This used to be commit 29919a71059b29fa27a49b1f5b84bb8881de65fc) --- source4/lib/replace/replace.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source4/lib/replace/replace.h') diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index f85c8de634f..f906e7a2f50 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -23,6 +23,10 @@ #ifndef _replace_h #define _replace_h +#if defined(_MSC_VER) || defined(__MINGW32__) +#include "lib/replace/win32/replace.h" +#endif + #ifdef __COMPAR_FN_T #define QSORT_CAST (__compar_fn_t) #endif @@ -31,6 +35,15 @@ #define QSORT_CAST (int (*)(const void *, const void *)) #endif +#ifndef HAVE_STRERROR +extern char *sys_errlist[]; +#define strerror(i) sys_errlist[i] +#endif + +#ifndef HAVE_ERRNO_DECL +extern int errno; +#endif + #ifndef HAVE_STRDUP char *strdup(const char *s); #endif @@ -136,4 +149,13 @@ typedef unsigned char u_int8_t; #define HAVE_SOCKLEN_T 1 #endif +#ifdef HAVE_DLFCN_H +#include +#endif + +#ifndef HAVE_SECURE_MKSTEMP +#define mkstemp(path) rep_mkstemp(path) +int rep_mkstemp(char *temp); +#endif + #endif -- cgit