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)
This commit is contained in:
Owen Taylor 2003-08-18 15:17:03 +00:00 committed by Owen Taylor
parent e1700ed253
commit a22048876f
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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;