Add vasprintf() and asprintf() functions missing on AIX

These functions are used by code in the library, even though these
functions started as GNU extensions, they are present in all BSDs,
so we expose them as part of our interface on AIX.
This commit is contained in:
Guillem Jover
2024-02-12 01:04:37 +01:00
parent 5392f0c1a4
commit ec7f5ee984
7 changed files with 141 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright © 2004-2005, 2009, 2011-2013 Guillem Jover <guillem@hadrons.org>
* Copyright © 2004-2024 Guillem Jover <guillem@hadrons.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -44,8 +44,18 @@
#include <bsd/sys/cdefs.h>
#endif
#include <sys/types.h>
#if defined(_AIX)
#include <stdarg.h>
#endif
__BEGIN_DECLS
#if defined(_AIX)
int asprintf(char **strp, char const *fmt, ...)
__printflike(2, 3);
int vasprintf(char **strp, char const *fmt, va_list args)
__printflike(2, 0);
#endif
const char *fmtcheck(const char *, const char *);
/* XXX: The function requires cooperation from the system libc to store the