From: <man...@us...> - 2013-04-13 13:43:33
|
Revision: 1870 http://sourceforge.net/p/modplug/code/1870 Author: manxorist Date: 2013-04-13 13:43:27 +0000 (Sat, 13 Apr 2013) Log Message: ----------- [Ref] Replace __declspec(align(n)) with a macro ALIGN(n) defined in typedefs.h Modified Paths: -------------- trunk/OpenMPT/common/typedefs.h trunk/OpenMPT/soundlib/ModChannel.h Modified: trunk/OpenMPT/common/typedefs.h =================================================================== --- trunk/OpenMPT/common/typedefs.h 2013-04-13 13:07:51 UTC (rev 1869) +++ trunk/OpenMPT/common/typedefs.h 2013-04-13 13:43:27 UTC (rev 1870) @@ -29,9 +29,22 @@ #ifdef _MSC_VER #define CountOf(x) _countof(x) #else - #define CountOf(x) (sizeof(x)/sizeof(x[0])) + #define CountOf(x) (sizeof((x))/sizeof((x)[0])) #endif +#if defined(_MSC_VER) +//#define USE_PRAGMA_PACK +#define PACKED __declspec(align(1)) +#elif defined(__GNUC__) +#define PACKED __attribute__((packed))) __attribute__((aligned(1)))) +#endif + +#if defined(_MSC_VER) +#define ALIGN(n) __declspec(align(n)) +#elif defined(__GNUC__) +#define ALIGN(n) __attribute__((aligned(n))) +#endif + #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif Modified: trunk/OpenMPT/soundlib/ModChannel.h =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h 2013-04-13 13:07:51 UTC (rev 1869) +++ trunk/OpenMPT/soundlib/ModChannel.h 2013-04-13 13:43:27 UTC (rev 1870) @@ -13,7 +13,7 @@ #pragma warning(disable : 4324) //structure was padded due to __declspec(align()) // Mix Channel Struct -struct __declspec(align(32)) ModChannel +struct ALIGN(32) ModChannel { // Envelope playback info struct EnvInfo @@ -176,7 +176,7 @@ // Default pattern channel settings -struct __declspec(align(32)) ModChannelSettings +struct ALIGN(32) ModChannelSettings { FlagSet<ChannelFlags> dwFlags; // Channel flags uint16 nPan; // Initial pan (0...256) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |