|
From: Jan S. <ha...@st...> - 2012-09-25 08:00:46
|
On Sep 25 08:50:08, Motiejus Jakštys wrote:
> On Tue, Sep 25, 2012 at 09:13:57AM +0200, Jan Stary wrote:
> > > These are not used anywhere in sox
> >
> > What makes you say that? util.h says
>
> Late night I guess. :)
>
> > #ifdef _stati64
> > #define stat _stati64
> > #else
> > #define stat _stat
> > #endif
> >
> > So on a system which does have _stati64,
> > that is used as 'stat'.
>
> i586-mingw32msvc/include/sys/stat.h:
>
> struct _stati64 {
> _dev_t st_dev;
> ...
> };
>
> That way if "util.h" is included before <sys/stat.h>,
you mean util.h being included _after_ sys/stat.h;
which it typically is.
> the latter is translated to
>
> struct stat { /* replaced by macro defined in "util.h" /*
> _dev_t st_dev;
> ...
> };
Yes. I thought that's the purpose of having those #define's.
> > (Not that I know a system with _stati64.)
>
> mingw32 4.2.1.dfsg-2ubuntu1
>
> > Well, isn't 'stat' defined on every reasonable system?
> > Isn't the purpose of the above to redefine it?
>
> It is. But it is redefining it incorrectly (_stati64 is not a macro,
> it's a struct!).
Of course it's a struct; 'stat' is a struct too.
> > Which might be strange: a system with _stati64
> > is probably already using it as its own stat, right?
>
> I guess so. This is really clumsy.
>
> > I don't know why sox doesn't just use the given
> > system's stat everywhere.
>
> "util.h" is really strange. Maybe somebody knows why:
>
> 1. sox checking for _stati64 constant?
No, not 'constant'. SoX checks if '_stati64' is defined
- which is probably a way to find out whether we are on
a system that has struct _stati64.
> 2. sox redefining stat?
>
> I was trying to solve the issue doing least impact possible, wrongly. It
> would be nice if somebody could explain what was the intent behind these
> stat redefinitions.
Agreed.
Jan
|