Remove masking macros for getwc(), putwc(), putwchar() and getwchar().
Although there was nothing wrong with getwc() and putwc(), getwchar() and putwchar() assumed that <stdio.h> had been included before <wchar.h>, which is not allowed by the standard.
This commit is contained in:
parent
ee38d590ff
commit
3619568a64
@ -186,9 +186,4 @@ size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
||||
#endif
|
||||
__END_DECLS
|
||||
|
||||
#define getwc(fp) fgetwc(fp)
|
||||
#define getwchar() fgetwc(stdin)
|
||||
#define putwc(wc, fp) fputwc((wc), (fp))
|
||||
#define putwchar(wc) fputwc((wc), stdout)
|
||||
|
||||
#endif /* !_WCHAR_H_ */
|
||||
|
@ -36,10 +36,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* Synonym for fgetwc(). The only difference is that getwc(), if it is a
|
||||
* macro, may evaluate `fp' more than once. Function call overhead is not
|
||||
* an issue here: wchar.h #define's getwc to fgetwc.
|
||||
* macro, may evaluate `fp' more than once.
|
||||
*/
|
||||
#undef getwc
|
||||
wint_t
|
||||
getwc(FILE *fp)
|
||||
{
|
||||
|
@ -35,10 +35,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include "local.h"
|
||||
|
||||
/*
|
||||
* Synonym for fgetwc(stdin). Function call overhead is not an issue here:
|
||||
* wchar.h #define's getwchar() to fgetwc(stdin).
|
||||
* Synonym for fgetwc(stdin).
|
||||
*/
|
||||
#undef getwchar
|
||||
wint_t
|
||||
getwchar(void)
|
||||
{
|
||||
|
@ -36,10 +36,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
/*
|
||||
* Synonym for fputwc(). The only difference is that putwc(), if it is a
|
||||
* macro, may evaluate `fp' more than once. Function call overhead is not
|
||||
* an issue here: wchar.h #define's putwc to fputwc.
|
||||
* macro, may evaluate `fp' more than once.
|
||||
*/
|
||||
#undef putwc
|
||||
wint_t
|
||||
putwc(wchar_t wc, FILE *fp)
|
||||
{
|
||||
|
@ -35,10 +35,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include "local.h"
|
||||
|
||||
/*
|
||||
* Synonym for fputwc(wc, stdout). Function call overhead is not an issue here:
|
||||
* wchar.h #define's putwchar(wc) to fgetwc(wc, stdout).
|
||||
* Synonym for fputwc(wc, stdout).
|
||||
*/
|
||||
#undef putwchar
|
||||
wint_t
|
||||
putwchar(wchar_t wc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user