This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _GLIBCPP_HAVE_S_ISREG always undefined for cross compilers (problem with ifstream::in_avail())


Hi!

Am Freitag, 2. Januar 2004 14:47 schrieb Gernot Hillier:
> Abstract:
>
> I think I found out that c++config.h always has
> _GLIBCPP_HAVE_S_ISREG/_IFREG undefined for cross compilers because
> configure.ac then doesn't call tests which need linking. Therefore the
> GLIBCPP_CHECK_S_ISREG_OR_S_IFREG macro is never called and therefore both
> symbols stay undefined.
>
> This seems to lead to a partly non-functional ifstream::in_avail() method
> (will always return 0 direct after opening a file).
[...]

Just for the records: in the meantime, I found out, that the real problem 
(compared to a natively compiled libstdc++) is that FIONREAD is not defined.

Cause for this: because of the cross compiler case, AC_CHECK_HEADERS(sys/
ioctl.h sys/filio.h) is not called (why?) which leads to a non defined 
_GLIBCPP_HAVE_SYS_IOCTL_H which leads to non-inclusion of sys/ioctl.h. 
Therefore, FIONREAD isn't defined.

For a native build, _GLIBCPP_HAVE_SYS_IOCTL_H and _GLIBCPP_HAVE_S_ISREG is 
defined and _GLIBCPP_HAVE_S_IFREG is undefined for me in gcc-3.3's libstdc++.

-- 
Bye,

Gernot Hillier
CT SE 2
Siemens AG, Mch P


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]