Print this page
Fix compile errors, code review feedback, and add basic libc test suite.

@@ -46,51 +46,51 @@
 #ifndef _LOCALE_T
 #define _LOCALE_T
 typedef struct locale *locale_t;
 #endif
 
-int mbsinit_l(const mbstate_t *, locale_t);
+extern int mbsinit_l(const mbstate_t *, locale_t);
 
-size_t mbsrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
+extern size_t mbsrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
     size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
 
-size_t mbsnrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
+extern size_t mbsnrtowcs_l(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
     size_t, size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
 
-char *strptime_l(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
+extern char *strptime_l(const char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
     struct tm *_RESTRICT_KYWD, locale_t);
 
-int wcwidth_l(wchar_t, locale_t);
+extern int wcwidth_l(wchar_t, locale_t);
 
-int wcswidth_l(const wchar_t *, size_t, locale_t);
+extern int wcswidth_l(const wchar_t *, size_t, locale_t);
 
-int iswspecial_l(wint_t, locale_t);
-int iswnumber_l(wint_t, locale_t);
-int iswhexnumber_l(wint_t, locale_t);
-int iswideogram_l(wint_t, locale_t);
-int iswphonogram_l(wint_t, locale_t);
+extern int iswspecial_l(wint_t, locale_t);
+extern int iswnumber_l(wint_t, locale_t);
+extern int iswhexnumber_l(wint_t, locale_t);
+extern int iswideogram_l(wint_t, locale_t);
+extern int iswphonogram_l(wint_t, locale_t);
 
-wint_t btowc_l(int, locale_t);
-int wctob_l(wint_t, locale_t);
-size_t mbrtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
+extern wint_t btowc_l(int, locale_t);
+extern int wctob_l(wint_t, locale_t);
+extern size_t mbrtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
+    size_t, mbstate_t *_RESTRICT_KYWD, locale_t);
+extern size_t mbstowcs_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
+    size_t, locale_t);
+extern int mblen_l(const char *, size_t, locale_t);
+extern size_t mbrlen_l(const char *_RESTRICT_KYWD, size_t,
     mbstate_t *_RESTRICT_KYWD, locale_t);
-size_t mbstowcs_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
+extern int mbtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
     locale_t);
-int mblen_l(const char *, size_t, locale_t);
-size_t mbrlen_l(const char *_RESTRICT_KYWD, size_t, mbstate_t *_RESTRICT_KYWD,
-    locale_t);
-int mbtowc_l(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t,
-    locale_t);
-size_t wcsrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
+extern size_t wcsrtombs_l(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
     size_t len, mbstate_t *_RESTRICT_KYWD, locale_t);
-size_t wcrtomb_l(char *_RESTRICT_KYWD, wchar_t, mbstate_t *_RESTRICT_KYWD,
-    locale_t);
-size_t wcstombs_l(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD, size_t,
-    locale_t);
-int wctomb_l(char *, wchar_t, locale_t);
+extern size_t wcrtomb_l(char *_RESTRICT_KYWD, wchar_t,
+    mbstate_t *_RESTRICT_KYWD, locale_t);
+extern size_t wcstombs_l(char *_RESTRICT_KYWD, const wchar_t *_RESTRICT_KYWD,
+    size_t, locale_t);
+extern int wctomb_l(char *, wchar_t, locale_t);
 
-unsigned char __mb_cur_max_l(locale_t);
+extern unsigned char __mb_cur_max_l(locale_t);
 #ifndef MB_CUR_MAX_L
 #define MB_CUR_MAX_L(l) (__mb_cur_max_l(l))
 #endif
 
 

@@ -97,12 +97,12 @@
 #if defined(_XPG4) && !defined(_FILEDEFED) || __cplusplus >= 199711L
 #define _FILEDEFED
 typedef __FILE FILE;
 #endif
 
-wint_t fgetwc_l(FILE *, locale_t);
-wint_t getwc_l(FILE *, locale_t);
+extern wint_t fgetwc_l(FILE *, locale_t);
+extern wint_t getwc_l(FILE *, locale_t);
 
 #ifndef getwchar_l
 #define getwchar_l(l)   fgetwc_l(stdin, (l))
 #endif