Author: matt
Date: 2010-11-18 10:43:41 -0800 (Thu, 18 Nov 2010)
New Revision: 7873
Log:
Fixed ARM Unicode cross compilation issue (STR #2432)
Modified:
branches/branch-1.3/CHANGES
branches/branch-1.3/src/xutf8/utf8Wrap.c
Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2010-11-18 18:39:32 UTC (rev 7872)
+++ branches/branch-1.3/CHANGES 2010-11-18 18:43:41 UTC (rev 7873)
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.3.0
+ - Fixed ARM Unicode cross compilation issue (STR #2432)
- Improved support for faulty X11 clients (STR #2385)
- Fixed xclass support for Fl_Window (STR #2053)
- Fixed Caps Lock handling in X11/XIM (STR #2366)
Modified: branches/branch-1.3/src/xutf8/utf8Wrap.c
===================================================================
--- branches/branch-1.3/src/xutf8/utf8Wrap.c 2010-11-18 18:39:32 UTC (rev
7872)
+++ branches/branch-1.3/src/xutf8/utf8Wrap.c 2010-11-18 18:43:41 UTC (rev
7873)
@@ -43,6 +43,21 @@
* extern const char *encoding_name(int num);
*/
+/* The ARM header files have a bug by not taking into account that ARM cpu
+ * likes pacing to 4 bytes. This little trick defines our own version of
+ * XChar2b which does not have this problem
+ */
+
+typedef struct {
+ unsigned char byte1;
+ unsigned char byte2;
+}
+#if defined(__GNUC__) && defined(__arm__) && !defined(__ARM_EABI__)
+__attribute__ ((packed))
+#endif
+Fl_XChar2b;
+
+
/*********************************************************************/
/** extract a list of font from the base font name list **/
/*********************************************************************/
@@ -328,8 +343,8 @@
int *encodings; /* encodings array */
XFontStruct **fonts; /* fonts array */
- XChar2b buf[128]; /* drawing buffer */
- XChar2b *ptr; /* pointer to the drawing buffer */
+ Fl_XChar2b buf[128]; /* drawing buffer */
+ Fl_XChar2b *ptr; /* pointer to the drawing buffer */
int fnum; /* index of the current font in the fonts
array*/
int i; /* current byte in the XChar2b buffer */
int first; /* first valid font index */
@@ -449,7 +464,7 @@
int *encodings; /* encodings array */
XFontStruct **fonts; /* fonts array */
- XChar2b buf[128]; /* drawing buffer */
+ Fl_XChar2b buf[128]; /* drawing buffer */
int fnum; /* index of the current font in the fonts array*/
int i; /* current byte in the XChar2b buffer */
int first; /* first valid font index */
@@ -559,7 +574,7 @@
int x;
int *encodings; /* encodings array */
XFontStruct **fonts; /* fonts array */
- XChar2b buf[128]; /* drawing buffer */
+ Fl_XChar2b buf[128]; /* drawing buffer */
int fnum; /* index of the current font in the fonts array*/
int i; /* current byte in the XChar2b buffer */
int first; /* first valid font index */
@@ -739,7 +754,7 @@
int x;
int *encodings; /* encodings array */
XFontStruct **fonts; /* fonts array */
- XChar2b buf[8]; /* drawing buffer */
+ Fl_XChar2b buf[8]; /* drawing buffer */
int fnum; /* index of the current font in the fonts array*/
int i; /* current byte in the XChar2b buffer */
int first; /* first valid font index */
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit