This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch] Fix multiple definitions of __chclass, __state_table, etc.
- From: kazu at codesourcery dot com (Kazu Hirata)
- To: newlib at sourceware dot org
- Cc: corinna at vinschen dot de
- Date: Tue, 21 Apr 2009 21:05:19 -0700 (PDT)
- Subject: [patch] Fix multiple definitions of __chclass, __state_table, etc.
Hi,
Attached is a patch to fix a "multiple definition" error that appears
to come from stdio/local.h and stdlib/local.h.
Tested by building newlib and running Hello, world on fido. OK to
apply?
Kazu Hirata
2009-04-22 Kazu Hirata <kazu@codesourcery.com>
* libc/stdio/local.h (__chclass, __state_table, __action_table):
Add extern to the declarations.
* libc/stdlib/local.h (__iso_8859_conv, __cp_conv): Likewise.
Index: newlib/libc/stdio/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/local.h,v
retrieving revision 1.28
diff -u -d -p -r1.28 local.h
--- newlib/libc/stdio/local.h 11 Mar 2009 11:53:22 -0000 1.28
+++ newlib/libc/stdio/local.h 22 Apr 2009 03:58:59 -0000
@@ -222,6 +222,6 @@ typedef enum {
PWPOS, /* get positional parameter value for variable width or precision */
} __ACTION;
-_CONST __CH_CLASS __chclass[256];
-_CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS];
-_CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS];
+extern _CONST __CH_CLASS __chclass[256];
+extern _CONST __STATE __state_table[MAX_STATE][MAX_CH_CLASS];
+extern _CONST __ACTION __action_table[MAX_STATE][MAX_CH_CLASS];
Index: newlib/libc/stdlib/local.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/local.h,v
retrieving revision 1.4
diff -u -d -p -r1.4 local.h
--- newlib/libc/stdlib/local.h 17 Apr 2009 22:15:43 -0000 1.4
+++ newlib/libc/stdlib/local.h 22 Apr 2009 03:58:59 -0000
@@ -57,10 +57,10 @@ int __big5_mbtowc (struct _reent *, wcha
#endif
#endif
-wchar_t __iso_8859_conv[14][0x60];
+extern wchar_t __iso_8859_conv[14][0x60];
int __iso_8859_index (const char *);
-wchar_t __cp_conv[12][0x80];
+extern wchar_t __cp_conv[12][0x80];
int __cp_index (const char *);
#include <float.h>