Merge pull request #815 in FS/freeswitch from ~ALEXANDR.DUBOVIKOV_GMAIL.COM/freeswitch:feature/FS-9078-hepv2-and-hepv3-support-windows-pragma to master

* commit '024af441b89ca21c1d93f1c2f6e24f2e4b480aa8':
  one push one pop
  FS-9078 added #pragma for MSVC compiler
This commit is contained in:
Mike Jerris 2016-04-19 18:08:29 -05:00
commit 4c50fea53d
1 changed files with 26 additions and 11 deletions

View File

@ -145,67 +145,79 @@ struct hep_ip6hdr {
#endif
/* HEPv3 types */
#if (defined __SUNPRO_CC) || defined(__SUNPRO_C) || defined(_MSC_VER)
#define PACKED
#endif
#ifndef PACKED
#define PACKED __attribute__ ((__packed__))
#endif
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif
struct hep_chunk {
uint16_t vendor_id;
uint16_t type_id;
uint16_t length;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk hep_chunk_t;
struct hep_chunk_uint8 {
hep_chunk_t chunk;
uint8_t data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_uint8 hep_chunk_uint8_t;
struct hep_chunk_uint16 {
hep_chunk_t chunk;
uint16_t data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_uint16 hep_chunk_uint16_t;
struct hep_chunk_uint32 {
hep_chunk_t chunk;
uint32_t data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_uint32 hep_chunk_uint32_t;
struct hep_chunk_str {
hep_chunk_t chunk;
char *data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_str hep_chunk_str_t;
struct hep_chunk_ip4 {
hep_chunk_t chunk;
struct in_addr data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_ip4 hep_chunk_ip4_t;
struct hep_chunk_ip6 {
hep_chunk_t chunk;
struct in6_addr data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_ip6 hep_chunk_ip6_t;
struct hep_chunk_payload {
hep_chunk_t chunk;
char *data;
} __attribute__((packed));
} PACKED;
typedef struct hep_chunk_payload hep_chunk_payload_t;
struct hep_ctrl {
char id[4];
uint16_t length;
} __attribute__((packed));
} PACKED;
typedef struct hep_ctrl hep_ctrl_t;
@ -219,11 +231,14 @@ struct hep_generic {
hep_chunk_uint32_t time_usec;
hep_chunk_uint8_t proto_t;
hep_chunk_uint32_t capt_id;
} __attribute__((packed));
} PACKED;
#ifdef _MSC_VER
#pragma pack(pop)
#endif
typedef struct hep_generic hep_generic_t;
/** Maximum size when streaming. */
#define MSG_SSIZE_MAX (USIZE_MAX)