Remove compiler warnings when building Bionic.

Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
diff --git a/libc/include/wchar.h b/libc/include/wchar.h
index df456ef..9b744a5 100644
--- a/libc/include/wchar.h
+++ b/libc/include/wchar.h
@@ -72,7 +72,7 @@
 
 #define  WCHAR_MAX   INT_MAX
 #define  WCHAR_MIN   INT_MIN
-#define  WEOF        ((wchar_t)(-1))
+#define  WEOF        ((wint_t)(-1))
 
 extern wint_t            btowc(int);
 extern int               fwprintf(FILE *, const wchar_t *, ...);