mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-16 01:03:16 -05:00
Remove/replace non-gcc compiler-specific defines and pragmas
Remove MSVC-specific defines and pragmas, use __attribute__((packed)) where needed.
This commit is contained in:
parent
3dd76cf9e9
commit
d8a9772afc
6
src/io.c
6
src/io.c
@ -2,12 +2,6 @@
|
|||||||
* Generic IO handling for files/sockets/etc
|
* Generic IO handling for files/sockets/etc
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#define _CRT_SECURE_NO_WARNINGS 1601
|
|
||||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
|
||||||
#define _CRT_NONSTDC_NO_DEPRECATE 1
|
|
||||||
#pragma warning(disable: 4996)
|
|
||||||
|
|
||||||
#ifdef LARGE_FILE
|
#ifdef LARGE_FILE
|
||||||
# define _LARGEFILE_SOURCE
|
# define _LARGEFILE_SOURCE
|
||||||
# define _LARGEFILE64_SOURCE
|
# define _LARGEFILE64_SOURCE
|
||||||
|
@ -12,19 +12,12 @@
|
|||||||
|
|
||||||
#include "ff-plugins.h"
|
#include "ff-plugins.h"
|
||||||
|
|
||||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
||||||
# define _PACKED __attribute((packed))
|
|
||||||
#else
|
|
||||||
# define _PACKED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct tag_scan_id3header {
|
typedef struct tag_scan_id3header {
|
||||||
unsigned char id[3];
|
unsigned char id[3];
|
||||||
unsigned char version[2];
|
unsigned char version[2];
|
||||||
unsigned char flags;
|
unsigned char flags;
|
||||||
unsigned char size[4];
|
unsigned char size[4];
|
||||||
} _PACKED SCAN_ID3HEADER;
|
} __attribute__((packed)) SCAN_ID3HEADER;
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
#ifndef TRUE
|
#ifndef TRUE
|
||||||
# define TRUE 1
|
# define TRUE 1
|
||||||
|
@ -223,26 +223,20 @@ WMA_GUID wma_guidlist[] = {
|
|||||||
{ NULL, NULL, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" }
|
{ NULL, NULL, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0" }
|
||||||
};
|
};
|
||||||
|
|
||||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
|
||||||
# define _PACKED __attribute((packed))
|
|
||||||
#else
|
|
||||||
# define _PACKED
|
|
||||||
#endif
|
|
||||||
#define MAYBEFREE(x) { free((x)); }
|
#define MAYBEFREE(x) { free((x)); }
|
||||||
|
|
||||||
#pragma pack(1)
|
|
||||||
typedef struct tag_wma_header {
|
typedef struct tag_wma_header {
|
||||||
unsigned char objectid[16];
|
unsigned char objectid[16];
|
||||||
unsigned long long size;
|
unsigned long long size;
|
||||||
unsigned int objects;
|
unsigned int objects;
|
||||||
char reserved1;
|
char reserved1;
|
||||||
char reserved2;
|
char reserved2;
|
||||||
} _PACKED WMA_HEADER;
|
} __attribute__((packed)) WMA_HEADER;
|
||||||
|
|
||||||
typedef struct tag_wma_subheader {
|
typedef struct tag_wma_subheader {
|
||||||
unsigned char objectid[16];
|
unsigned char objectid[16];
|
||||||
long long size;
|
long long size;
|
||||||
} _PACKED WMA_SUBHEADER;
|
} __attribute__((packed)) WMA_SUBHEADER;
|
||||||
|
|
||||||
typedef struct tag_wma_stream_properties {
|
typedef struct tag_wma_stream_properties {
|
||||||
unsigned char stream_type[16];
|
unsigned char stream_type[16];
|
||||||
@ -252,15 +246,13 @@ typedef struct tag_wma_stream_properties {
|
|||||||
unsigned int ecdl;
|
unsigned int ecdl;
|
||||||
unsigned short int flags;
|
unsigned short int flags;
|
||||||
unsigned int reserved;
|
unsigned int reserved;
|
||||||
} _PACKED WMA_STREAM_PROP;
|
} __attribute__((packed)) WMA_STREAM_PROP;
|
||||||
|
|
||||||
typedef struct tag_wma_header_extension {
|
typedef struct tag_wma_header_extension {
|
||||||
unsigned char reserved_1[16];
|
unsigned char reserved_1[16];
|
||||||
unsigned short int reserved_2;
|
unsigned short int reserved_2;
|
||||||
unsigned int data_size;
|
unsigned int data_size;
|
||||||
} _PACKED WMA_HEADER_EXT;
|
} __attribute__((packed)) WMA_HEADER_EXT;
|
||||||
|
|
||||||
#pragma pack()
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Forwards
|
* Forwards
|
||||||
|
Loading…
x
Reference in New Issue
Block a user