From 9544d86ceb12fdd8b3a02e26fb0c9f8f0b3cac0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Wed, 16 Dec 2020 17:56:20 -0300 Subject: [PATCH] musl-legacy-compat: add error.h header. --- srcpkgs/musl-legacy-compat/files/error.h | 29 ++++++++++++++++++++++++ srcpkgs/musl-legacy-compat/template | 8 ++++--- 2 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/musl-legacy-compat/files/error.h diff --git a/srcpkgs/musl-legacy-compat/files/error.h b/srcpkgs/musl-legacy-compat/files/error.h new file mode 100644 index 00000000000..4505784182a --- /dev/null +++ b/srcpkgs/musl-legacy-compat/files/error.h @@ -0,0 +1,29 @@ +#ifndef _ERROR_H_ +#define _ERROR_H_ + +#include +#include +#include +#include +#include + +#warning usage of non-standard #include is deprecated + +static unsigned int error_message_count = 0; + +static inline void error(int status, int errnum, const char* format, ...) +{ + va_list ap; + fprintf(stderr, "%s: ", program_invocation_name); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (errnum) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + error_message_count++; + if (status) + exit(status); +} + +#endif /* _ERROR_H_ */ diff --git a/srcpkgs/musl-legacy-compat/template b/srcpkgs/musl-legacy-compat/template index 3c926e315cd..afc447314f4 100644 --- a/srcpkgs/musl-legacy-compat/template +++ b/srcpkgs/musl-legacy-compat/template @@ -1,7 +1,7 @@ # Template file for 'musl-legacy-compat' pkgname=musl-legacy-compat -version=0.3 -revision=4 +version=0.4 +revision=1 archs="*-musl" bootstrap=yes short_desc="Legacy compatibility headers for the musl libc" @@ -10,9 +10,11 @@ license="BSD-2-Clause, BSD-3-Clause" homepage="http://www.voidlinux.org" do_install() { - for f in ${FILESDIR}/*.h; do + for f in ${FILESDIR}/{cdefs,queue,tree}.h + do vinstall ${f} 644 usr/include/sys done + vinstall ${FILESDIR}/error.h 644 usr/include sed -n '3,32p' < ${FILESDIR}/queue.h > LICENSE.BSD-3-Clause sed -n '2,26p' < ${FILESDIR}/tree.h > LICENSE.BSD-2-Clause