Files
grep/compat.h
T
2026-07-06 19:17:43 +08:00

22 lines
458 B
C

#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#ifndef __DECONST
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
#endif
static inline const char *getprogname() {
return "grep";
}
static inline void warnc(int code, const char *fmt, ...) {
va_list args;
fprintf(stderr, "warning: ");
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
fprintf(stderr, ": %s\n", strerror(code));
}