[MPlayer-dev-eng] [PATCH 1/2] Remove direct uses of __attribute__((packed)).
KO Myung-Hun
komh78 at gmail.com
Mon Jan 25 13:04:36 EET 2021
Hi/2.
Reimar Döffinger wrote:
> It is not portable and ideally it should not be used
> at all.
> However as a quick-fix wrap it in a macro so it is not
> necessary to edit each occurrence individually to support
> other compilers.
> Code that is completely platform-dependent anyway is not changed
> at this point.
This patch breaks OS/2 build.
> ---
> libmpcodecs/ad_realaud.c | 5 +-
> libmpdemux/asf.h | 29 ++++++++---
> libmpdemux/aviheader.h | 5 +-
> libmpdemux/demux_ogg.c | 5 +-
> libmpdemux/ms_hdr.h | 23 ++++++---
> loader/dshow/guids.h | 10 +++-
Many commas cause a trouble.
> loader/dshow/mediatype.h | 5 +-
> loader/qtx/qtxsdk/components.h | 90 +++++++++++++++++++++++++---------
> mppacked.h | 33 +++++++++++++
> stream/stream_cddb.c | 12 +++--
1. Missing mppacked.h
2. Many commas cause a trouble.
> stream/stream_netstream.h | 9 +++-
> stream/tvi_dshow.c | 5 +-
> 12 files changed, 184 insertions(+), 47 deletions(-)
> create mode 100644 mppacked.h
>
See below for specific error messages.
[...]
> diff --git a/loader/dshow/guids.h b/loader/dshow/guids.h
> index 76a4970d2..5cf5e0344 100644
> --- a/loader/dshow/guids.h
> +++ b/loader/dshow/guids.h
> @@ -18,18 +18,23 @@ under MinGW
>
> #include "mediatype.h"
>
> +#include "mppacked.h"
> +
> //#define Debug if(1)
> #define Debug if(0)
>
>
> typedef long long REFERENCE_TIME;
>
> -typedef struct __attribute__((__packed__)) RECT32
> +MP_PACKED(
> +typedef struct, RECT32
> {
> int left, top, right, bottom;
> } RECT32;
> +)
In file included from loader/dshow/iunk.h:9,
from loader/dshow/interfaces.h:10,
from loader/dshow/inputpin.h:4,
from loader/dshow/DS_Filter.h:4,
from loader/dshow/DS_AudioDecoder.c:11:
loader/dshow/guids.h:34:1: error: macro "MP_PACKED" passed 5 arguments,
but takes just 2
34 | )
| ^
> diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
> index 06695f81a..6f3a68d9e 100644
> --- a/stream/stream_cddb.c
> +++ b/stream/stream_cddb.c
> @@ -132,6 +132,7 @@ static int read_toc(const char *dev)
> #elif defined(__OS2__)
> UCHAR auchParamDisk[4] = {'C', 'D', '0', '1'};
>
> +MP_PACKED(
stream/stream_cddb.c: In function 'read_toc':
stream/stream_cddb.c:135:1: error: implicit declaration of function
'MP_PACKED' [-Werror=implicit-function-declaration]
135 | MP_PACKED(
| ^~~~~~~~~
stream/stream_cddb.c:136:5: error: expected expression before 'struct'
136 | struct {
| ^~~~~~
stream/stream_cddb.c:144:2: error: expected ';' before 'MP_PACKED'
144 | )
| ^
| ;
145 |
146 | MP_PACKED(
| ~~~~~~~~~
> struct {
> BYTE bFirstTrack;
> BYTE bLastTrack;
> @@ -139,20 +140,25 @@ static int read_toc(const char *dev)
> BYTE bLeadOutS;
> BYTE bLeadOutM;
> BYTE bLeadOutReserved;
> - } __attribute__((packed)) sDataDisk;
> + }, sDataDisk;
> +)
>
> +MP_PACKED(
> struct {
> UCHAR auchSign[4];
> BYTE bTrack;
> - } __attribute__((packed)) sParamTrack = {{'C', 'D', '0', '1'},};
> + }, sParamTrack = {{'C', 'D', '0', '1'},};
> +)
>
stream/stream_cddb.c: In function 'read_toc':
stream/stream_cddb.c:152:1: error: macro "MP_PACKED" passed 6 arguments,
but takes just 2
152 | )
| ^
In file included from stream/stream_cddb.c:57:
./mppacked.h:29: note: macro "MP_PACKED" defined here
29 | #define MP_PACKED(type, name_and_def) \
|
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.10 on Intel Core i7-3615QM 2.30GHz with 8GB RAM
Korean OS/2 User Community : http://www.os2.kr/
More information about the MPlayer-dev-eng
mailing list