All users of POST_PACKED_STRUCTURE also include <jack/types.h>, so to avoid code duplication, we move the definition into a single place. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>pull/3/head
@@ -28,22 +28,6 @@ extern "C" { | |||||
#include <jack/types.h> | #include <jack/types.h> | ||||
#include <jack/weakmacros.h> | #include <jack/weakmacros.h> | ||||
#ifndef POST_PACKED_STRUCTURE | |||||
#ifdef __GNUC__ | |||||
/* POST_PACKED_STRUCTURE needs to be a macro which | |||||
expands into a compiler directive. The directive must | |||||
tell the compiler to arrange the preceding structure | |||||
declaration so that it is packed on byte-boundaries rather | |||||
than use the natural alignment of the processor and/or | |||||
compiler. | |||||
*/ | |||||
#define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||||
#else | |||||
/* Add other things here for non-gcc platforms */ | |||||
#endif | |||||
#endif | |||||
/** | /** | ||||
* Transport states. | * Transport states. | ||||
*/ | */ | ||||
@@ -29,6 +29,22 @@ typedef uint64_t jack_uuid_t; | |||||
typedef int32_t jack_shmsize_t; | typedef int32_t jack_shmsize_t; | ||||
#ifndef POST_PACKED_STRUCTURE | |||||
#ifdef __GNUC__ | |||||
/* POST_PACKED_STRUCTURE needs to be a macro which | |||||
expands into a compiler directive. The directive must | |||||
tell the compiler to arrange the preceding structure | |||||
declaration so that it is packed on byte-boundaries rather | |||||
than use the natural alignment of the processor and/or | |||||
compiler. | |||||
*/ | |||||
# define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||||
#else | |||||
/* Add other things here for non-gcc platforms */ | |||||
#endif | |||||
#endif | |||||
/** | /** | ||||
* Type used to represent sample frame counts. | * Type used to represent sample frame counts. | ||||
*/ | */ | ||||