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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=104080
@ -186,9 +186,4 @@ size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
|
|||||||
#endif
|
#endif
|
||||||
__END_DECLS
|
__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_ */
|
#endif /* !_WCHAR_H_ */
|
||||||
|
@ -36,10 +36,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Synonym for fgetwc(). The only difference is that getwc(), if it is a
|
* 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
|
* macro, may evaluate `fp' more than once.
|
||||||
* an issue here: wchar.h #define's getwc to fgetwc.
|
|
||||||
*/
|
*/
|
||||||
#undef getwc
|
|
||||||
wint_t
|
wint_t
|
||||||
getwc(FILE *fp)
|
getwc(FILE *fp)
|
||||||
{
|
{
|
||||||
|
@ -35,10 +35,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Synonym for fgetwc(stdin). Function call overhead is not an issue here:
|
* Synonym for fgetwc(stdin).
|
||||||
* wchar.h #define's getwchar() to fgetwc(stdin).
|
|
||||||
*/
|
*/
|
||||||
#undef getwchar
|
|
||||||
wint_t
|
wint_t
|
||||||
getwchar(void)
|
getwchar(void)
|
||||||
{
|
{
|
||||||
|
@ -36,10 +36,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Synonym for fputwc(). The only difference is that putwc(), if it is a
|
* 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
|
* macro, may evaluate `fp' more than once.
|
||||||
* an issue here: wchar.h #define's putwc to fputwc.
|
|
||||||
*/
|
*/
|
||||||
#undef putwc
|
|
||||||
wint_t
|
wint_t
|
||||||
putwc(wchar_t wc, FILE *fp)
|
putwc(wchar_t wc, FILE *fp)
|
||||||
{
|
{
|
||||||
|
@ -35,10 +35,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "local.h"
|
#include "local.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Synonym for fputwc(wc, stdout). Function call overhead is not an issue here:
|
* Synonym for fputwc(wc, stdout).
|
||||||
* wchar.h #define's putwchar(wc) to fgetwc(wc, stdout).
|
|
||||||
*/
|
*/
|
||||||
#undef putwchar
|
|
||||||
wint_t
|
wint_t
|
||||||
putwchar(wchar_t wc)
|
putwchar(wchar_t wc)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user