Browse Source

Refactor POST_PACKED_STRUCTURE into types.h

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
Adrian Knoth 11 years ago
parent
commit
aea850adb3
2 changed files with 16 additions and 16 deletions
  1. +0
    -16
      transport.h
  2. +16
    -0
      types.h

+ 0
- 16
transport.h View File

@@ -28,22 +28,6 @@ extern "C" {
#include <jack/types.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.
*/


+ 16
- 0
types.h View File

@@ -29,6 +29,22 @@ typedef uint64_t jack_uuid_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.
*/


Loading…
Cancel
Save