]> git.sur5r.net Git - openldap/blob - include/ac/errno.h
Generate OpenLDAP id for configure
[openldap] / include / ac / errno.h
1 /* Generic errno.h */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms are permitted only
8  * as authorized by the OpenLDAP Public License.  A copy of this
9  * license is available at http://www.OpenLDAP.org/license.html or
10  * in file LICENSE in the top-level directory of the distribution.
11  */
12
13 #ifndef _AC_ERRNO_H
14 #define _AC_ERRNO_H
15
16 #if defined( HAVE_ERRNO_H )
17 # include <errno.h>
18 #elif defined( HAVE_SYS_ERRNO_H )
19 # include <sys/errno.h>
20 #endif
21
22 #ifndef HAVE_SYS_ERRLIST
23         /* no sys_errlist */
24 #       define          sys_nerr        0
25 #       define          sys_errlist     ((char **)0)
26 #elif DECL_SYS_ERRLIST 
27         /* have sys_errlist but need declaration */
28         extern int      sys_nerr;
29         extern char     *sys_errlist[];
30 #endif
31
32 #ifdef HAVE_STRERROR
33 #define STRERROR(err)   strerror(err)
34 #else
35 #define STRERROR(err) \
36         ((err) > -1 && (err) < sys_nerr ? sys_errlist[(err)] : "unknown")
37 #endif
38
39 extern char* strerror_r();
40     
41 #endif /* _AC_ERRNO_H */