configure: Check for error.h

For portability, check for error.h during configure and define
HAVE_ERROR_H accordingly.

If this header is not available, emulate the functionality of error()
from glibc with an inline wrapper in include/c.h.
This commit is contained in:
Rainer Müller
2013-02-20 20:14:29 +01:00
parent 6df4fc403d
commit 838e5d8941
3 changed files with 29 additions and 1 deletions

View File

@ -1,5 +1,7 @@
#include <errno.h>
#include <error.h>
#ifdef HAVE_ERROR_H
# include <error.h>
#endif
#ifdef HAVE_STDIO_EXT_H
# include <stdio_ext.h>
#else
@ -12,6 +14,9 @@
#include "nls.h"
#include "fileutils.h"
#ifndef HAVE_ERROR_H
# include "c.h" /* for error() emulation */
#endif
int close_stream(FILE * stream)
{