[vlc-devel] [PATCH] WinCE: remove call to unsupported getcwd()

jpd at m2x.nl jpd at m2x.nl
Tue May 19 11:30:13 CEST 2009


On Tue, May 19, 2009 10:48, Pierre Ynard wrote:
>> #ifdefs do clutter up the code something fierce, so (static inline)
>> wrapper functions would indeed be preferrable. You indicated you
>> seemed to think this particular fix was not elegible for such
>> treatment somehow. Would you care to explain why?
>
> Because in this case the wrapper function would look like:
>
> char *getcwd(char *buf, size_t size)
> {
> #ifdef UNDER_CE
>     return strncpy(buf, "\\My Documents", size);
> #endif
> }

Make that:

#ifdef UNDER_CE
char *getcwd(char *buf, size_t size)
{
    return strncpy(buf, "\\My Documents", size);
}
#endif

because under unix getcwd already exists.

Adding comments full of disdain for this sad state of affairs is
left to your own discretion, of course.


> It's semantically very wrong and not reusable, I doubt you want that.

The aim here is to glue wince into working without cluttering up the code
too much, which #ifdefs clearly don't do very well.





More information about the vlc-devel mailing list