summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-01-13 16:30:43 +0000
committerLaurent Bercot <ska@appnovation.com>2023-01-13 16:30:43 +0000
commit3e1bbd5d33826c5d7807a051ee22db3452ee4b21 (patch)
tree88203cada2c4baf77cb500b1625d37b12f4ba68f
parentee2aeefa170b9806e719723f94ba933c90a9ae8b (diff)
downloadskalibs-3e1bbd5d33826c5d7807a051ee22db3452ee4b21.tar.xz
Remove stdarg functions from strerr, everything is __VA_ARGS__ now
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--NEWS4
-rw-r--r--package/deps.mak4
-rw-r--r--src/include/skalibs/strerr.h5
-rw-r--r--src/libstddjb/strerr_diel.c24
-rw-r--r--src/libstddjb/strerr_dielsys.c23
-rw-r--r--src/libstddjb/strerr_warnl.c22
-rw-r--r--src/libstddjb/strerr_warnlsys.c22
7 files changed, 3 insertions, 101 deletions
diff --git a/NEWS b/NEWS
index 2f98153..a31efca 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,9 @@ In 2.13.0.0
- Bugfixes.
- New functions: buffer_timed_put(), buffer_timed_puts().
- - strerr.h revamped. strerr_die, strerr_warn, strerr_diesys, strerr_warnsys removed.
+ - strerr.h revamped. strerr_die, strerr_warn, strerr_diesys, strerr_warnsys
+and all the previous strerr2 macros are now __VA_ARGS__ macros around
+strerr_diev() and friends.
In 2.12.0.1
diff --git a/package/deps.mak b/package/deps.mak
index e1322cc..86415a3 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -555,12 +555,8 @@ src/libstddjb/stralloc_reverse.o src/libstddjb/stralloc_reverse.lo: src/libstddj
src/libstddjb/stralloc_reverse_blocks.o src/libstddjb/stralloc_reverse_blocks.lo: src/libstddjb/stralloc_reverse_blocks.c src/include/skalibs/stralloc.h
src/libstddjb/stralloc_shrink.o src/libstddjb/stralloc_shrink.lo: src/libstddjb/stralloc_shrink.c src/include/skalibs/alloc.h src/include/skalibs/stralloc.h
src/libstddjb/stralloc_zero.o src/libstddjb/stralloc_zero.lo: src/libstddjb/stralloc_zero.c src/include/skalibs/stralloc.h
-src/libstddjb/strerr_diel.o src/libstddjb/strerr_diel.lo: src/libstddjb/strerr_diel.c src/include/skalibs/strerr.h
-src/libstddjb/strerr_dielsys.o src/libstddjb/strerr_dielsys.lo: src/libstddjb/strerr_dielsys.c src/include/skalibs/strerr.h
src/libstddjb/strerr_diev.o src/libstddjb/strerr_diev.lo: src/libstddjb/strerr_diev.c src/include/skalibs/strerr.h
src/libstddjb/strerr_dievsys.o src/libstddjb/strerr_dievsys.lo: src/libstddjb/strerr_dievsys.c src/include/skalibs/strerr.h
-src/libstddjb/strerr_warnl.o src/libstddjb/strerr_warnl.lo: src/libstddjb/strerr_warnl.c src/include/skalibs/strerr.h
-src/libstddjb/strerr_warnlsys.o src/libstddjb/strerr_warnlsys.lo: src/libstddjb/strerr_warnlsys.c src/include/skalibs/strerr.h
src/libstddjb/strerr_warnv.o src/libstddjb/strerr_warnv.lo: src/libstddjb/strerr_warnv.c src/include/skalibs/buffer.h src/include/skalibs/strerr.h
src/libstddjb/strerr_warnvsys.o src/libstddjb/strerr_warnvsys.lo: src/libstddjb/strerr_warnvsys.c src/include/skalibs/buffer.h src/include/skalibs/strerr.h
src/libstddjb/string_format.o src/libstddjb/string_format.lo: src/libstddjb/string_format.c src/include/skalibs/bytestr.h src/include/skalibs/stralloc.h
diff --git a/src/include/skalibs/strerr.h b/src/include/skalibs/strerr.h
index 8cff167..d2b7492 100644
--- a/src/include/skalibs/strerr.h
+++ b/src/include/skalibs/strerr.h
@@ -10,11 +10,6 @@ extern void strerr_warnvsys (char const *const *, unsigned int) ;
extern void strerr_diev (int, char const *const *, unsigned int) gccattr_noreturn ;
extern void strerr_dievsys(int, char const *const *, unsigned int) gccattr_noreturn ;
-extern void strerr_warnl (unsigned int, ...) ;
-extern void strerr_warnlsys (unsigned int, ...) ;
-extern void strerr_diel (int, unsigned int, ...) gccattr_noreturn ;
-extern void strerr_dielsys (int, unsigned int, ...) gccattr_noreturn ;
-
#define strerr_array(...) ((char const *const[]){__VA_ARGS__})
#define strerr_warnn(n, ...) strerr_warnv(strerr_array(__VA_ARGS__), (n))
#define strerr_warnnsys(n, ...) strerr_warnvsys(strerr_array(__VA_ARGS__), (n))
diff --git a/src/libstddjb/strerr_diel.c b/src/libstddjb/strerr_diel.c
deleted file mode 100644
index d142402..0000000
--- a/src/libstddjb/strerr_diel.c
+++ /dev/null
@@ -1,24 +0,0 @@
-/* ISC license. */
-
-/* MT-unsafe */
-
-#include <stdarg.h>
-#include <unistd.h>
-
-#include <skalibs/strerr.h>
-
-void strerr_diel (int e, unsigned int n, ...)
-{
- if (n)
- {
- va_list ap ;
- char const *v[n] ;
- va_start(ap, n) ;
- va_arg(ap, unsigned int) ;
- for (unsigned int i = 0 ; i < n ; i++)
- v[i++] = va_arg(ap, char const *) ;
- va_end(ap) ;
- strerr_warnv(v, n) ;
- }
- _exit(e) ;
-}
diff --git a/src/libstddjb/strerr_dielsys.c b/src/libstddjb/strerr_dielsys.c
deleted file mode 100644
index 5c0e334..0000000
--- a/src/libstddjb/strerr_dielsys.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* ISC license. */
-
-/* MT-unsafe */
-
-#include <stdarg.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <skalibs/strerr.h>
-
-void strerr_dielsys (int e, unsigned int n, ...)
-{
- va_list ap ;
- char const *v[n+1] ;
- va_start(ap, n) ;
- va_arg(ap, unsigned int) ;
- for (unsigned int i = 0 ; i < n ; i++)
- v[i++] = va_arg(ap, char const *) ;
- va_end(ap) ;
- v[n] = strerror(errno) ;
- strerr_diev(e, v, n+1) ;
-}
diff --git a/src/libstddjb/strerr_warnl.c b/src/libstddjb/strerr_warnl.c
deleted file mode 100644
index 17c370d..0000000
--- a/src/libstddjb/strerr_warnl.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ISC license. */
-
-/* MT-unsafe */
-
-#include <stdarg.h>
-
-#include <skalibs/strerr.h>
-
-void strerr_warnl (unsigned int n, ...)
-{
- if (n)
- {
- va_list ap ;
- char const *v[n] ;
- va_start(ap, n) ;
- va_arg(ap, unsigned int) ;
- for (unsigned int i = 0 ; i < n ; i++)
- v[i++] = va_arg(ap, char const *) ;
- va_end(ap) ;
- strerr_warnv(v, n) ;
- }
-}
diff --git a/src/libstddjb/strerr_warnlsys.c b/src/libstddjb/strerr_warnlsys.c
deleted file mode 100644
index fbd7a6b..0000000
--- a/src/libstddjb/strerr_warnlsys.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/* ISC license. */
-
-/* MT-unsafe */
-
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-
-#include <skalibs/strerr.h>
-
-void strerr_warnlsys (unsigned int n, ...)
-{
- va_list ap ;
- char const *v[n+1] ;
- va_start(ap, n) ;
- va_arg(ap, unsigned int) ;
- for (unsigned int i = 0 ; i < n ; i++)
- v[i++] = va_arg(ap, char const *) ;
- va_end(ap) ;
- v[n] = strerror(errno) ;
- strerr_warnv(v, n+1) ;
-}