summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--src/xutf8/utf8Wrap.c25
2 files changed, 21 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 2ebc67362..82a863959 100644
--- a/CHANGES
+++ b/CHANGES
@@ -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)
diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c
index 4961ac0f4..bb3676d13 100644
--- a/src/xutf8/utf8Wrap.c
+++ b/src/xutf8/utf8Wrap.c
@@ -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 @@ XUtf8DrawRtlString(Display *display,
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 @@ XUtf8DrawString(Display *display,
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 @@ XUtf8TextWidth(XUtf8FontStruct *font_set,
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 @@ XUtf8UcsWidth(XUtf8FontStruct *font_set,
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 */