Commit 642f4080 authored by cutealien's avatar cutealien

- Modified struct packing solution to work with gcc 4.7 on MinGW. Which makes...

- Modified struct packing solution to work with gcc 4.7 on MinGW. Which makes for example bmp-loader work again (textures in example 01 for example). Note: If this should be backported to 1.7 we should maybe just set the -mno-ms-bitfield flag for mingw there (not as nice, but will probably work good enough as workaround for what we use in Irrlicht and we don't have our nice packing headers there yet so we would have to do that all over the place).
- Also added new packing headers to c::b project file.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4226 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d0d209e2
......@@ -22,7 +22,17 @@
# pragma pack( push, 1 )
# define PACK_STRUCT
#elif defined( __GNUC__ )
# define PACK_STRUCT __attribute__((packed))
// Using pragma pack might work with earlier gcc versions already, but
// it started to be necessary with gcc 4.7 on mingw unless compiled with -mno-ms-bitfields.
// And I found some hints on the web that older gcc versions on the other hand had sometimes
// trouble with pragma pack while they worked with __attribute__((packed)).
# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7)
# pragma pack( push, packing )
# pragma pack( 1 )
# define PACK_STRUCT
# else
# define PACK_STRUCT __attribute__((packed))
#endif
#else
# error compiler not supported
#endif
......
......@@ -10,6 +10,10 @@
# pragma pack( pop, packing )
#elif defined (__DMC__)
# pragma pack( pop )
#elif defined( __GNUC__ )
# if (__GNUC__ >= 4 ) && (__GNUC_MINOR__ >= 7)
# pragma pack( pop, packing )
# endif
#endif
#undef PACK_STRUCT
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment