This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob/PATCH] libc/stdlib/local.h: Declare __mbtowc/__wctomb extern


Hi,

I applied the below patch as obvious.  __mbtowc and __wctomb should be
explicitely declared extern, otherwise we get a copy in every object
that references it.  Thanks to DJ Delorie for catching this.


Corinna


	* libc/stdlib/local.h (__mbtowc): Declare extern.
	(__wctomb): Ditto.


Index: libc/stdlib/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/local.h,v
retrieving revision 1.2
diff -u -p -r1.2 local.h
--- libc/stdlib/local.h	24 Mar 2009 10:13:27 -0000	1.2
+++ libc/stdlib/local.h	9 Apr 2009 08:23:47 -0000
@@ -11,7 +11,8 @@ char *__locale_charset ();
 #include <wchar.h>
 #endif
 
-int (*__wctomb) (struct _reent *, char *, wchar_t, const char *, mbstate_t *);
+extern int (*__wctomb) (struct _reent *, char *, wchar_t, const char *,
+			mbstate_t *);
 int __ascii_wctomb (struct _reent *, char *, wchar_t, const char *,
 		    mbstate_t *);
 #ifdef _MB_CAPABLE
@@ -29,8 +30,8 @@ int __big5_wctomb (struct _reent *, char
 #endif
 #endif
 
-int (*__mbtowc) (struct _reent *, wchar_t *, const char *, size_t,
-                 const char *, mbstate_t *);
+extern int (*__mbtowc) (struct _reent *, wchar_t *, const char *, size_t,
+			const char *, mbstate_t *);
 int __ascii_mbtowc (struct _reent *, wchar_t *, const char *, size_t,
 		    const char *, mbstate_t *);
 #ifdef _MB_CAPABLE


-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]