recipes: libs/barelibs: Use the force when copy the libraries
[dragora.git] / archive / elfutils / error.h
blobef06827a0ba080f6fe7ac0f7610534d0f9294333
1 #ifndef _ERROR_H_
2 #define _ERROR_H_
4 #include <stdarg.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <string.h>
8 #include <errno.h>
10 static unsigned int error_message_count = 0;
12 static inline void error(int status, int errnum, const char* format, ...)
14 va_list ap;
15 fprintf(stderr, "%s: ", program_invocation_name);
16 va_start(ap, format);
17 vfprintf(stderr, format, ap);
18 va_end(ap);
19 if (errnum)
20 fprintf(stderr, ": %s", strerror(errnum));
21 fprintf(stderr, "\n");
22 error_message_count++;
23 if (status)
24 exit(status);
27 #endif /* _ERROR_H_ */