Skip to content

Commit

Permalink
Wrapper PACKED_ATTRIBUTE definition to allow consumers/prerequisites …
Browse files Browse the repository at this point in the history
…to override definition - avoids gcc warnings when building client products
  • Loading branch information
rmcdonald committed Nov 9, 2015
1 parent 13d3325 commit 1c445f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
#ifndef __UTP_TYPES_H__
#define __UTP_TYPES_H__

// Allow libutp consumers or prerequisites to override PACKED_ATTRIBUTE
#ifndef PACKED_ATTRIBUTE
#ifdef __GNUC__
// Used for gcc tool chains accepting but not supporting pragma pack
// See http://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html
#define PACKED_ATTRIBUTE __attribute__((__packed__))
#else
#define PACKED_ATTRIBUTE
#endif
#endif // ndef PACKED_ATTRIBUTE

#ifdef __GNUC__
#define ALIGNED_ATTRIBUTE(x) __attribute__((aligned (x)))
Expand Down

0 comments on commit 1c445f9

Please sign in to comment.