mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-27 15:52:28 +00:00
Fix some issues and do some code cleanup
This commit is contained in:
parent
1f229e4efc
commit
312ed5c67c
72 changed files with 880 additions and 982 deletions
45
third_party/make/error.c
vendored
45
third_party/make/error.c
vendored
|
@ -57,48 +57,9 @@ void (*error_print_progname) (void);
|
|||
/* This variable is incremented each time 'error' is called. */
|
||||
unsigned int error_message_count;
|
||||
|
||||
#ifdef _LIBC
|
||||
/* In the GNU C library, there is a predefined variable for this. */
|
||||
|
||||
# define program_name program_invocation_name
|
||||
|
||||
/* In GNU libc we want do not want to use the common name 'error' directly.
|
||||
Instead make it a weak alias. */
|
||||
extern void __error (int status, int errnum, const char *message, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
extern void __error_at_line (int status, int errnum, const char *file_name,
|
||||
unsigned int line_number, const char *message,
|
||||
...)
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)));
|
||||
# define error __error
|
||||
# define error_at_line __error_at_line
|
||||
|
||||
# define fflush(s) _IO_fflush (s)
|
||||
# undef putc
|
||||
# define putc(c, fp) _IO_putc (c, fp)
|
||||
|
||||
|
||||
#else /* not _LIBC */
|
||||
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
/* Get _get_osfhandle. */
|
||||
# if GNULIB_MSVC_NOTHROW
|
||||
# include "msvc-nothrow.h"
|
||||
# else
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The gnulib override of fcntl is not needed in this file. */
|
||||
# undef fcntl
|
||||
|
||||
# define program_name getprogname ()
|
||||
|
||||
# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
|
||||
# define __strerror_r strerror_r
|
||||
# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
|
||||
#endif /* not _LIBC */
|
||||
#undef fcntl
|
||||
#define program_name getprogname ()
|
||||
#define __strerror_r strerror_r
|
||||
|
||||
/* Return non-zero if FD is open. */
|
||||
static int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue