scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

wctob.c (156B)


      1 #include <stdio.h>
      2 #include <wchar.h>
      3 
      4 #undef wctob
      5 
      6 int
      7 wctob(wint_t wc)
      8 {
      9 	unsigned long w = wc;
     10 
     11 	if (wc == WEOF || w > 128)
     12 		return EOF;
     13 	return wc;
     14 }