1
0
Fork 0
util-linux/include/fgetwc_or_err.h
Daniel Baumann c36e531662
Adding upstream version 2.41.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 11:26:35 +02:00

23 lines
406 B
C

#ifndef UTIL_LINUX_FGETWC_OR_ERR_H
#define UTIL_LINUX_FGETWC_OR_ERR_H
#include <stdio.h>
#include <wchar.h>
#include <errno.h>
#include "widechar.h"
#include "c.h"
#include "nls.h"
static inline wint_t fgetwc_or_err(FILE *stream) {
wint_t ret;
errno = 0;
ret = fgetwc(stream);
if (ret == WEOF && errno != 0)
err(EXIT_FAILURE, _("fgetwc() failed"));
return ret;
}
#endif /* _FGETWC_OR_ERR_H */