scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

setlocale.c (293B)


      1 #include <locale.h>
      2 #include <stddef.h>
      3 #undef setlocale
      4 
      5 char *
      6 setlocale(int category, const char *locale)
      7 {
      8 	if (category > LC_TIME || category < LC_ALL)
      9 		return NULL;
     10 	if (!locale ||
     11 	    locale[0] == '\0' ||
     12 	    locale[0] == 'C' && locale[1] == '\0') {
     13 		return "C";
     14 	}
     15 	return NULL;
     16 }