Commit 5841c630 authored by unknown's avatar unknown

Prevent a collision with the system's '#define errno ...' by guarding the variable declaration.


include/my_sys.h:
  There are platforms which use '#define errno ...' and then cause a collision with
  'extern int errno;', one example is OpenBSD.
  Rather than treat them explicitly by the 'HAVE_ERRNO_AS_DEFINE', we can check for these
  by using '#ifndef errno'.
parent 41624daa
...@@ -206,11 +206,13 @@ void __CDECL hfree(void *ptr); ...@@ -206,11 +206,13 @@ void __CDECL hfree(void *ptr);
#endif #endif
#endif /* MSDOS */ #endif /* MSDOS */
#ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE #ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h> /* errno is a define */ #include <errno.h> /* errno is a define */
#else #else
extern int errno; /* declare errno */ extern int errno; /* declare errno */
#endif #endif
#endif /* #ifndef errno */
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */ extern char *home_dir; /* Home directory for user */
extern char *my_progname; /* program-name (printed in errors) */ extern char *my_progname; /* program-name (printed in errors) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment