From b66d71c8c3e14813c93860f73a315c33d77b0866 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Mar 2005 10:22:50 +0100 Subject: [PATCH] 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'. (Backported from 5.0, as the problem was discovered there first.) --- include/my_sys.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/my_sys.h b/include/my_sys.h index 0fdb8d640e7..d6104a6a3a9 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -193,11 +193,13 @@ void __CDECL hfree(void *ptr); #endif #endif /* MSDOS */ +#ifndef errno /* did we already get it? */ #ifdef HAVE_ERRNO_AS_DEFINE #include /* errno is a define */ #else extern int errno; /* declare errno */ #endif +#endif /* #ifndef errno */ extern const char ** NEAR my_errmsg[]; extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE]; extern char *home_dir; /* Home directory for user */