Fix last commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef INCLUDED_UTIL_H
|
||||
#define INCLUDED_UTIL_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#if __has_attribute(format)
|
||||
#define PRINTF_LIKE(i, j) __attribute__((format(printf, i, j)))
|
||||
#else
|
||||
#define PRINTF_LIKE(i, j)
|
||||
#endif
|
||||
|
||||
void *realloc_safe(void *oldptr, size_t size);
|
||||
void *malloc_safe(size_t size);
|
||||
|
||||
// asprintf is not POSIX
|
||||
PRINTF_LIKE(2, 3)
|
||||
int alloc_sprintf(char *restrict *restrict out, const char *restrict fmt, ...);
|
||||
|
||||
PRINTF_LIKE(1, 2)
|
||||
void log_error(const char *restrict fmt, ...);
|
||||
void log_errno(const char *detail);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user