#ifndef _RTLDENV_H
#define _RTLDENV_H
#include <stddef.h>
#include <stdarg.h>
void *xcalloc(size_t);
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
void *xmalloc_aligned(size_t, size_t, size_t);
char *xstrdup(const char *);
void xfree(void *);
#ifdef RTLD_LOADER
void xprintf(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
void xvprintf(const char *, va_list)
__attribute__((__format__(__printf__, 1, 0)));
void xsnprintf(char *, size_t, const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));
size_t xvsnprintf(char *, size_t, const char *, va_list)
__attribute__((__format__(__printf__, 3, 0)));
void xwarn(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
void xwarnx(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
void xerr(int, const char *, ...)
__attribute__((__noreturn__, __format__(__printf__, 2, 3)));
void xerrx(int, const char *, ...)
__attribute__((__noreturn__, __format__(__printf__, 2, 3)));
void xassert(const char *, int, const char *) __dead;
const char *xstrerror(int);
int xunsetenv(const char *);
# ifdef DEBUG
# define assert(cond) ((cond) ? (void) 0 : xassert(__FILE__, __LINE__, #cond))
# else
# define assert(cond) (void) 0
# endif
#else
# include <assert.h>
# include <stdio.h>
# include <err.h>
# define xprintf printf
# define xvprintf vprintf
# define xsnprintf snprintf
# define xvsnprintf vsnprintf
# define xwarn warn
# define xwarnx warnx
# define xerr err
# define xerrx errx
# define xassert assert
# define xstrerror strerror
#endif
#endif