[vdr] Thread start functions and external C linkage (VDR starts it's threads "incorrectly")

Jonas Munsin jmunsin at gmail.com
Thu Feb 16 11:36:01 CET 2006


On 2/12/06, Sascha Volkenandt (ML) <lists at magoa.net> wrote:
>
> Klaus Schmidinger wrote:
> > This would allow anybody to do
> >
> >   cThread t;
> >   StartThread(&t);
> >
> > which I don't think would be a good thing to do.
> >
> > Any ideas how to prevent this from happening?
>
> It's perfectly okay to declare StartThread
>
> extern "C" static void *StartThread(cThread *Thread);
>
>
Shouldn't a nameless namepsace be used here? gcc 3.4.3 does not like extern
"C" static
at all (error: multiple storage classes in declaration of ...). i.e., in
thread.c:

namespace {
    extern "C" void *StartThread(cThread *Thread)
    {
    ....
    }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.linuxtv.org/pipermail/vdr/attachments/20060216/6388e02c/attachment.htm


More information about the vdr mailing list