[FFmpeg-devel] [PATCH] Set systems that should support DOS paths in configure
Måns Rullgård
mans
Tue Oct 7 09:26:58 CEST 2008
"Ramiro Polla" <ramiro.polla at gmail.com> writes:
> On Mon, Oct 6, 2008 at 7:52 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
>> "Ramiro Polla" <ramiro.polla at gmail.com> writes:
>>
>>> On Mon, Oct 6, 2008 at 1:42 PM, Ramiro Polla <ramiro.polla at gmail.com> wrote:
>>>> Hi,
>>>>
>>>> On Fri, Oct 3, 2008 at 7:58 PM, M?ns Rullg?rd <mans at mansr.com> wrote:
>>>>> "Ramiro Polla" <ramiro.polla at gmail.com> writes:
>>>>>> $subj
>>>> [...]
>>>>>> Index: libavformat/os_support.h
>>>>>> ===================================================================
>>>>>> --- libavformat/os_support.h (revision 15464)
>>>>>> +++ libavformat/os_support.h (working copy)
>>>>>> @@ -35,6 +35,12 @@
>>>>>> # define lseek(f,p,w) _lseeki64((f), (p), (w))
>>>>>> #endif
>>>>>>
>>>>>> +#ifdef HAVE_DOS_PATHS
>>>>>> + #define is_dos_path(path) (path[1]==':')
>>>>>
>>>>> This allows anything as the "drive letter", though maybe that's
>>>>> considered OK.
>>>>
>>>> According to [0], only letters are allowed for the drive letter
>>>> (altough I've seen some program, fsdext2 IIRC, using numbers). Added
>>>> isalpha() for path[0].
>>>>
>>>>>> +#else
>>>>>> + #define is_dos_path(path) (0)
>>>>>
>>>>> Useless ().
>>>>
>>>> Removed.
>>>>
>>>> Also changed from #define to static inline int like ff_network_init().
>>>>
>>>> Ramiro Polla
>>>> [0] http://msdn.microsoft.com/en-us/library/cc232152.aspx
>>>>
>>>
>>> And now without the tabs in os_support.h
>>>
>>> Index: configure
>>> ===================================================================
>>> --- configure (revision 15572)
>>> +++ configure (working copy)
>>> @@ -750,6 +750,7 @@
>>> dev_video_bktr_ioctl_bt848_h
>>> dlfcn_h
>>> dlopen
>>> + dos_paths
>>> ebp_available
>>> ebx_available
>>> fast_64bit
>>> @@ -1291,6 +1292,7 @@
>>> SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
>>> SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
>>> objformat="win32"
>>> + enable dos_paths
>>> ;;
>>> cygwin*)
>>> target_os=cygwin
>>> @@ -1308,6 +1310,7 @@
>>> SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
>>> SHFLAGS='-shared -Wl,--enable-auto-image-base'
>>> objformat="win32"
>>> + enable dos_paths
>>> ;;
>>> *-dos|freedos|opendos)
>>> disable ffplay ffserver vhook
>>> @@ -1315,6 +1318,7 @@
>>> network_extralibs="-lsocket"
>>> EXESUF=".exe"
>>> objformat="win32"
>>> + enable dos_paths
>>> ;;
>>> linux)
>>> enable dv1394
>>> @@ -1346,6 +1350,7 @@
>>> SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
>>> SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
>>> disable vhook
>>> + enable dos_paths
>>> ;;
>>> interix)
>>> disable vhook
>>
>> OK
>
>>> 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.
--
M?ns Rullg?rd
mans at mansr.com
More information about the ffmpeg-devel
mailing list