+2021-08-23 Saleem Abdulrasool <abdulras@google.com>
+
+ * system.h: Remove inline definition for error and error_message_count
+ in the fallback path.
+ * Makefile.am (libeu_a_SOURCES): Add error.c.
+ * error.c: New file, moves the previous inline definitions to avoid
+ multiple definitions properly rather than relying on -fcommon and vague
+ linkage.
+
2021-08-21 Saleem Abdulrasool <abdulras@google.com>
* fixedsizehash.h: Remove unused STROF macro.
libeu_a_SOURCES = xstrdup.c xstrndup.c xmalloc.c next_prime.c \
crc32.c crc32_file.c \
- color.c printversion.c
+ color.c error.c printversion.c
noinst_HEADERS = fixedsizehash.h libeu.h system.h dynamicsizehash.h list.h \
eu-config.h color.h printversion.h bpf.h \
#if defined(HAVE_ERROR_H)
#include <error.h>
#elif defined(HAVE_ERR_H)
-#include <err.h>
-
-static int error_message_count = 0;
-
-static inline void error(int status, int errnum, const char *format, ...) {
- va_list argp;
-
- va_start(argp, format);
- verr(status, format, argp);
- va_end(argp);
-
- if (status)
- exit(status);
- ++error_message_count;
-}
+extern int error_message_count;
+void error(int status, int errnum, const char *format, ...);
#else
#error "err.h or error.h must be available"
#endif