mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-24 07:02:05 +08:00
Remove #undefs and fix formatting.
This commit is contained in:
parent
c31922b8c4
commit
59bc7c1f5f
@ -72,22 +72,18 @@ void
|
|||||||
rtems_bsd_program_unlock(void);
|
rtems_bsd_program_unlock(void);
|
||||||
|
|
||||||
#ifndef RTEMS_BSD_PROGRAM_NO_EXIT_WRAP
|
#ifndef RTEMS_BSD_PROGRAM_NO_EXIT_WRAP
|
||||||
#undef exit
|
|
||||||
#define exit(code) rtems_bsd_program_exit(code)
|
#define exit(code) rtems_bsd_program_exit(code)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RTEMS_BSD_PROGRAM_NO_ERROR_WRAP
|
#ifndef RTEMS_BSD_PROGRAM_NO_ERROR_WRAP
|
||||||
#undef error
|
|
||||||
#define error(fmt, ...) rtems_bsd_program_error(fmt, ## __VA_ARGS__)
|
#define error(fmt, ...) rtems_bsd_program_error(fmt, ## __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RTEMS_BSD_PROGRAM_NO_GETPROGNAME_WRAP
|
#ifndef RTEMS_BSD_PROGRAM_NO_GETPROGNAME_WRAP
|
||||||
#undef getprogname
|
|
||||||
#define getprogname() rtems_bsd_program_get_name()
|
#define getprogname() rtems_bsd_program_get_name()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RTEMS_BSD_PROGRAM_NO_PRINTF_WRAP
|
#ifndef RTEMS_BSD_PROGRAM_NO_PRINTF_WRAP
|
||||||
#undef printf
|
|
||||||
#define printf(...) fprintf(stdout, __VA_ARGS__)
|
#define printf(...) fprintf(stdout, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#undef printf
|
||||||
#include <machine/rtems-bsd-program.h>
|
#include <machine/rtems-bsd-program.h>
|
||||||
|
|
||||||
struct rtems_bsd_program_control {
|
struct rtems_bsd_program_control {
|
||||||
@ -121,12 +122,12 @@ rtems_bsd_program_exit(int exit_code)
|
|||||||
void
|
void
|
||||||
rtems_bsd_program_error(const char *fmt, ...)
|
rtems_bsd_program_error(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
va_start(list, fmt);
|
va_start(list, fmt);
|
||||||
vfprintf(stderr, fmt, list);
|
vfprintf(stderr, fmt, list);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
va_end(list);
|
va_end(list);
|
||||||
rtems_bsd_program_exit(1);
|
rtems_bsd_program_exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user