diff options
author | Owen Taylor <otaylor@redhat.com> | 2003-08-18 15:17:03 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-08-18 15:17:03 +0000 |
commit | a22048876f5482e7dea2357ea23b4f7a9b2a095f (patch) | |
tree | 7f322586db686744ac9b9805432072f03d8c4add /gdk-pixbuf | |
parent | e1700ed253e560689c85e9a551eb2bbc3a0c55f0 (diff) | |
download | gdk-pixbuf-a22048876f5482e7dea2357ea23b4f7a9b2a095f.tar.gz |
Add the correct alignment magic for Sun compiler and for GCC to get the
Mon Aug 18 10:25:29 2003 Owen Taylor <otaylor@redhat.com>
* gdk-pixdata.c (gdk_pixdata_to_csource): Add the correct
alignment magic for Sun compiler and for GCC to get
the strings aligned. (Patch from Brian Cameron, #117217)
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 6 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixdata.c | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 3c3a723b1..bc072dc9c 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +Mon Aug 18 10:25:29 2003 Owen Taylor <otaylor@redhat.com> + + * gdk-pixdata.c (gdk_pixdata_to_csource): Add the correct + alignment magic for Sun compiler and for GCC to get + the strings aligned. (Patch from Brian Cameron, #117217) + 2003-08-14 Matthias Clasen <maclas@gmx.de> * gdk-pixdata.c (gdk_pixdata_to_csource): Improve doc comment diff --git a/gdk-pixbuf/gdk-pixdata.c b/gdk-pixbuf/gdk-pixdata.c index f8730c301..445e7adf7 100644 --- a/gdk-pixbuf/gdk-pixdata.c +++ b/gdk-pixbuf/gdk-pixdata.c @@ -727,10 +727,22 @@ gdk_pixdata_to_csource (GdkPixdata *pixdata, img_buffer = stream; img_buffer_end = stream + stream_length; + APPEND (gstring, "#ifdef __SUNPRO_C\n"); + APPEND (gstring, "#pragma align 4 (%s)\n", name); + APPEND (gstring, "#endif\n"); + + APPEND (gstring, "#ifdef __GNUC__\n"); + APPEND (gstring, "%s%s%s %s[] __attribute__ ((__aligned__ (4))) = \n", + cdata.static_prefix, cdata.const_prefix, + cdata.dump_gtypes ? "guint8" : "unsigned char", + name); + APPEND (gstring, "#else\n"); APPEND (gstring, "%s%s%s %s[] = \n", cdata.static_prefix, cdata.const_prefix, cdata.dump_gtypes ? "guint8" : "unsigned char", name); + APPEND (gstring, "#endif\n"); + APPEND (gstring, "{ \"\"\n /* Pixbuf magic (0x%x) */\n \"", GDK_PIXBUF_MAGIC_NUMBER); cdata.pos = 3; |