I have seen this code:
#if !defined(errno)
extern int errno;
#endif
So my question is whether errno
is int or macro , because with #if
if can check macro defined or not and after we are doing extern int errno;
in errno.h it is defined like this
#ifdef _ERRNO_H
/* Declare the `errno' variable, unless it's defined as a macro by
bits/errno.h. This is the case in GNU, where it is a per-thread
variable. This redeclaration using the macro still works, but it
will be a function declaration without a prototype and may trigger
a -Wstrict-prototypes warning. */
#ifndef errno
extern int errno;
#endif
#endif