Adding upstream version 2.41.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
parent
9586bb3c92
commit
c36e531662
3661 changed files with 2164106 additions and 0 deletions
23
include/fgetwc_or_err.h
Normal file
23
include/fgetwc_or_err.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#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 */
|
Loading…
Add table
Add a link
Reference in a new issue