diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2010-11-18 18:43:41 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2010-11-18 18:43:41 +0000 |
| commit | 983a0d8ce4f835c5714052171307ca29c402b015 (patch) | |
| tree | e6626ab925dff1a3274521aad2d8c204fc9e9c5e /src/xutf8 | |
| parent | 8fa3fc272ae98ed5b741a8eb6425fca2c04ac62e (diff) | |
Fixed ARM Unicode cross compilation issue (STR #2432)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7873 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/xutf8')
| -rw-r--r-- | src/xutf8/utf8Wrap.c | 25 |
1 files changed, 20 insertions, 5 deletions
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 */ |
