Fixes warnings in clang for unrecognized attribute 'gcc_struct'

pull/208/head
Nick Overdijk 2013-12-14 01:40:00 +01:00
parent f433746bfa
commit 5b076fe234
1 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@
// MSVC 7,8,9 // MSVC 7,8,9
// GCC // GCC
// BORLAND (complains about 'pack state changed but not reverted', but works) // BORLAND (complains about 'pack state changed but not reverted', but works)
// Clang
// //
// //
// USAGE: // USAGE:
@ -25,7 +26,11 @@
# pragma pack(push,1) # pragma pack(push,1)
# define PACK_STRUCT # define PACK_STRUCT
#elif defined( __GNUC__ ) #elif defined( __GNUC__ )
# if defined(__clang__)
# define PACK_STRUCT __attribute__((__packed__))
# else
# define PACK_STRUCT __attribute__((gcc_struct, __packed__)) # define PACK_STRUCT __attribute__((gcc_struct, __packed__))
# endif
#else #else
# error Compiler not supported # error Compiler not supported
#endif #endif