Mailing List archive

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

[vdr] Re: plugins reentrance?



I demand that Stefan Taferner may or may not have written...

> On Saturday 04 December 2004 18:12, Rainer Zocholl wrote:
[snip]
>> #define strtok "please use strtok_r"
>>  ...
[snip]
> IMO a better way would be:

> #define warn_func(x) \
>   #warning "Using non thread safe function call" \
>   printf("%s:%d: replace %s with %s_r here\n",__FILE__,__LINE__,x),x

> #define strtok warn_func(strtok)
> #define localtime warn_func(localtime)
> ...

Or (given gcc 3.x):
  #pragma GCC poison strtok localtime ...

I'd put that in config.h

Either way, there are two local includes to be moved to after the system
includes - one each in plugin.c and recording.c - else you'll get errors in
the wrong places (although poisoning causing errors in system headers is,
arguably, a gcc bug).

-- 
| Darren Salt | nr. Ashington, | d youmustbejoking,demon,co,uk
| Debian,     | Northumberland | s zap,tartarus,org
| RISC OS     | Toon Army      | @
|   We've got Shearer, you haven't

A gleekzorp without a tornpee is like a quop without a fertsneet.




Home | Main Index | Thread Index