mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
win32: Don't use __attribute__ on MSVC
Use MSVC-equivalents for alignment and packing compiler directives when building on MSVC
This commit is contained in:
parent
63803bfac0
commit
bbde949e8e
3 changed files with 23 additions and 6 deletions
|
@ -10,7 +10,11 @@
|
||||||
|
|
||||||
#include "dboolhuff.h"
|
#include "dboolhuff.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__declspec(align(16)) const unsigned char vp8_norm[256] = {
|
||||||
|
#else
|
||||||
const unsigned char vp8_norm[256] __attribute__ ((aligned (16))) = {
|
const unsigned char vp8_norm[256] __attribute__ ((aligned (16))) = {
|
||||||
|
#endif
|
||||||
0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
|
0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
|
|
@ -31,7 +31,11 @@ typedef struct
|
||||||
unsigned int range;
|
unsigned int range;
|
||||||
} BOOL_DECODER;
|
} BOOL_DECODER;
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__declspec(align(16)) extern const unsigned char vp8_norm[256];
|
||||||
|
#else
|
||||||
extern const unsigned char vp8_norm[256] __attribute__((aligned(16)));
|
extern const unsigned char vp8_norm[256] __attribute__((aligned(16)));
|
||||||
|
#endif
|
||||||
|
|
||||||
int vp8dx_start_decode(BOOL_DECODER *br,
|
int vp8dx_start_decode(BOOL_DECODER *br,
|
||||||
const unsigned char *source,
|
const unsigned char *source,
|
||||||
|
|
|
@ -33,8 +33,12 @@
|
||||||
#define DEFAULT_MIN_FRAMES 0
|
#define DEFAULT_MIN_FRAMES 0
|
||||||
#define RTP_SBC_HEADER_TOTAL (12 + RTP_SBC_PAYLOAD_HEADER_SIZE)
|
#define RTP_SBC_HEADER_TOTAL (12 + RTP_SBC_PAYLOAD_HEADER_SIZE)
|
||||||
|
|
||||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
/* BEGIN: Packing for rtp_payload */
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma pack(push, 1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||||
/* FIXME: this seems all a bit over the top for a single byte.. */
|
/* FIXME: this seems all a bit over the top for a single byte.. */
|
||||||
struct rtp_payload
|
struct rtp_payload
|
||||||
{
|
{
|
||||||
|
@ -43,10 +47,8 @@ struct rtp_payload
|
||||||
guint8 is_last_fragment:1;
|
guint8 is_last_fragment:1;
|
||||||
guint8 is_first_fragment:1;
|
guint8 is_first_fragment:1;
|
||||||
guint8 is_fragmented:1;
|
guint8 is_fragmented:1;
|
||||||
} __attribute__ ((packed));
|
}
|
||||||
|
|
||||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||||
|
|
||||||
struct rtp_payload
|
struct rtp_payload
|
||||||
{
|
{
|
||||||
guint8 is_fragmented:1;
|
guint8 is_fragmented:1;
|
||||||
|
@ -54,12 +56,19 @@ struct rtp_payload
|
||||||
guint8 is_last_fragment:1;
|
guint8 is_last_fragment:1;
|
||||||
guint8 rfa0:1;
|
guint8 rfa0:1;
|
||||||
guint8 frame_count:4;
|
guint8 frame_count:4;
|
||||||
} __attribute__ ((packed));
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error "Unknown byte order"
|
#error "Unknown byte order"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
;
|
||||||
|
#pragma pack(pop)
|
||||||
|
#else
|
||||||
|
__attribute__ ((packed));
|
||||||
|
#endif
|
||||||
|
/* END: Packing for rtp_payload */
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
|
|
Loading…
Reference in a new issue