Martin Storsjö <[email protected]> writes:

> On Tue, 26 Jun 2012, Måns Rullgård wrote:
>
>> Martin Storsjö <[email protected]> writes:
>>
>>> From: "Ronald S. Bultje" <[email protected]>
>>>
>>> Mingw headers provide similar defines already (unconditional #defines,
>>> without any #undef or #ifdef around it), while MSVC doesn't have
>>> them.
>>>
>>> As an alternative, this could be moved to os_support.h, but then the
>>> sys/stat.h include would have to be moved there.
>>> ---
>>>  libavformat/file.c |    7 +++++++
>>>  1 file changed, 7 insertions(+)
>>>
>>> diff --git a/libavformat/file.c b/libavformat/file.c
>>> index cca9ec1..ad8ac40 100644
>>> --- a/libavformat/file.c
>>> +++ b/libavformat/file.c
>>> @@ -31,6 +31,13 @@
>>>  #include "os_support.h"
>>>  #include "url.h"
>>>
>>> +#ifndef S_IRUSR
>>> +#define S_IRUSR S_IREAD
>>> +#endif
>>> +#ifndef S_IWUSR
>>> +#define S_IWUSR S_IWRITE
>>> +#endif
>>
>> What guarantees that those fallbacks are defined?
>
> Nothing really.
>
> Thus, this probably belongs within some #if _WIN32 scope (since
> microsoft specs only the S_IREAD/S_IWRITE names).

I suspected as much.  Some other non-Unix system may well have yet other
names.

> Then we need to deal with the mingw headers that actually define
> similar fallbacks (undef them before defining ours), and deal with the
> sys/stat.h header being included both before and after
> os_support.h... Any hints on how to do that best?

Including sys/stat.h in os_support.h would take care of ordering problems.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to