mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
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'.
This commit is contained in:
parent
41624daa4c
commit
5841c6309a
1 changed files with 2 additions and 0 deletions
|
|
@ -206,11 +206,13 @@ void __CDECL hfree(void *ptr);
|
|||
#endif
|
||||
#endif /* MSDOS */
|
||||
|
||||
#ifndef errno /* did we already get it? */
|
||||
#ifdef HAVE_ERRNO_AS_DEFINE
|
||||
#include <errno.h> /* errno is a define */
|
||||
#else
|
||||
extern int errno; /* declare errno */
|
||||
#endif
|
||||
#endif /* #ifndef errno */
|
||||
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
|
||||
extern char *home_dir; /* Home directory for user */
|
||||
extern char *my_progname; /* program-name (printed in errors) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue