Google
  Web www.spinics.net

Fwd: Re: Video4Linux header files (and unnamed unions)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi,

Would you accept the following patch to the videodev2.h file, that all unnamed 
unions are appended "MY_UNION" or something like that?

--HPS

----------  Forwarded Message  ----------

On Saturday 19 May 2007, Luigi Rizzo wrote:
> On Sat, May 19, 2007 at 11:24:34PM +0200, Hans Petter Selasky wrote:
> > On Saturday 19 May 2007 21:14, Luigi Rizzo wrote:
>
> ...
>
> > > - i don't know how problematic is this, but v4l2 headers seem to use
> > >   unnamed unions which, last time i tried, conflict with the compiler
> > >   setting used to build the kernel. While this is possibly an
> > > orthogonal problem which we may have to address at some point (as
> > > unnamed unions seem to be a common paradigm in linux headers), it is
> > > yet another hurdle.
> >
> > Unnamed unions are not so good. I suggest that we terminate unnamed
> > unions with an "u".

We can make this a compile time option:

#ifdef NOT_GCC_4X
#define MY_UNION u
#else
#define MY_UNION 
#endif

union {

} MY_UNION;

I see no problem about that. Else it will be a nightmare to port the code to 
other and especially older compilers.

>
> It is not our choice. Linux v4l2 headers use these unions,
> software is written against these headers, we can't change the
> names unless we want to make extensive changes to the sources.

We can be compatible with both!

--HPS

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[Home]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Video Technology]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Plasma TVs]     [Video Projectors]     [PDAs]     [Xorg]     [Util Linux NG]     [Xfree86]     [Devices]     [Big List of Linux Books]     [Free Photo Albums]     [LCD TVs]     [Fedora Users]     [Webcams]     [Fedora Women]     [HDTV]     [ALSA Users]     [ALSA Devel]     [Stuff]     [SSH]     [DVB Maintainers]     [Linux USB]

Add to Google Powered by Linux