[FFmpeg-devel] [PATCH] Set systems that should support DOS paths in configure
Måns Rullgård
mans
Tue Oct 7 18:07:30 CEST 2008
Ramiro Polla wrote:
> Hi,
>
>>>>> Index: libavformat/os_support.h
>>>>> ===================================================================
>>>>> --- libavformat/os_support.h (revision 15572)
>>>>> +++ libavformat/os_support.h (working copy)
>>>>> @@ -32,6 +32,15 @@
>>>>> # define lseek(f,p,w) _lseeki64((f), (p), (w))
>>>>> #endif
>>>>>
>>>>> +static inline int is_dos_path(const char *path)
>>>>> +{
>>>>> +#ifdef HAVE_DOS_PATHS
>>>>> + if (isalpha(path[0]) && path[1] == ':')
>>>>> + return 1;
>>>>> +#endif
>>>>> + return 0;
>>>>> +}
>>>>> +
>>>>> #ifdef __BEOS__
>>>>> # include <sys/socket.h>
>>>>> # include <netinet/in.h>
>>>>
>>>> isalpha() needs #include <ctype.h>. I don't see it anywhere in the file.
>>>
>>> Added under a #ifdef HAVE_DOS_PATHS.
>>
>> Standard headers don't need #ifdef in most cases.
>
> I thought one of the reasons to #ifdef'ing it was to avoid including
> an unnecessary header.
#ifdefs are used to avoid attempting the impossible (including non-existent
headers and such), and to avoid generating code that isn't needed (thus
reducing the size of the final thing). Adding #ifdefs around headers
that are guaranteed to exist, and that have no unpleasant side-effects, is
only cluttering the code.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list