From 60b6c062f847a742fbc3c4ba4023bb8a0235da6d Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Thu, 5 Aug 1999 17:42:09 +0000 Subject: [PATCH] Changed BidEndianOrdered to BigEndianOrdered in datstrm.h Seek and Tell do the right thing in wxIn/OutputStream now Check for GNU extension in configure.in: this is needed for GLIBC 2.1/GCC 2.95 -> this enables _GNU_SOURCE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- acconfig.h | 1 + acinclude.m4 | 24 ++++++++++++++++++++++++ configure.in | 3 +++ include/wx/datstrm.h | 4 ++-- src/common/stream.cpp | 8 ++++---- src/unix/gsocket.c | 2 +- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/acconfig.h b/acconfig.h index 9e9bbb9865..203fec51bc 100644 --- a/acconfig.h +++ b/acconfig.h @@ -53,6 +53,7 @@ #undef __ULTRIX__ #undef __DATA_GENERAL__ #undef __EMX__ +#undef _GNU_SOURCE #undef __WINDOWS__ #undef __WIN95__ diff --git a/acinclude.m4 b/acinclude.m4 index 4c235b2e91..5f78fc1709 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -397,3 +397,27 @@ AC_DEFUN(WX_ARG_ENABLE, fi ]) +dnl - +dnl - GNU libc extension (added by GL) +dnl - + +AC_DEFUN(WX_GNU_EXTENSIONS, +[ +AC_MSG_CHECKING([if you need GNU extensions]) +AC_CACHE_VAL(wx_cv_gnu_extensions,[ + AC_TRY_COMPILE([#include ],[ + +#ifndef __GNU_LIBRARY__ + Compile error wanted +#endif + +], + [wx_cv_gnu_extensions=yes], + [wx_cv_gnu_extensions=no]) +]) + +AC_MSG_RESULT($wx_cv_gnu_extensions) +if test "$wx_cv_gnu_extensions" = "yes"; then + AC_DEFINE_UNQUOTED(_GNU_SOURCE) +fi +]) diff --git a/configure.in b/configure.in index f18379995c..4d6975506f 100644 --- a/configure.in +++ b/configure.in @@ -1250,6 +1250,9 @@ WX_CPP_BOOL dnl check whether overloading on size_t/int parameter works WX_CPP_SIZE_T_IS_NOT_INT +dnl check whether we should define _GNU_SOURCE +WX_GNU_EXTENSIONS + dnl --------------------------------------------------------------------------- dnl Check for functions dnl --------------------------------------------------------------------------- diff --git a/include/wx/datstrm.h b/include/wx/datstrm.h index ee557221a2..7b0fa1a613 100644 --- a/include/wx/datstrm.h +++ b/include/wx/datstrm.h @@ -41,7 +41,7 @@ public: wxDataInputStream& operator>>(double& i); wxDataInputStream& operator>>(float& f); - void BidEndianOrdered(bool be_order) { m_be_order = be_order; } + void BigEndianOrdered(bool be_order) { m_be_order = be_order; } protected: wxInputStream *m_input; bool m_be_order; @@ -69,7 +69,7 @@ class WXDLLEXPORT wxDataOutputStream { wxDataOutputStream& operator<<(double f); wxDataOutputStream& operator<<(float f); - void BidEndianOrdered(bool be_order) { m_be_order = be_order; } + void BigEndianOrdered(bool be_order) { m_be_order = be_order; } protected: wxOutputStream *m_output; bool m_be_order; diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 61de20d228..b22e5adb46 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -574,12 +574,12 @@ wxInputStream& wxInputStream::Read(wxOutputStream& stream_out) off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode) { - return wxInvalidOffset; + return OnSysSeek(pos, mode); } off_t wxInputStream::TellI() const { - return wxInvalidOffset; + return OnSysTell(); } // -------------------- @@ -622,12 +622,12 @@ wxOutputStream& wxOutputStream::Write(wxInputStream& stream_in) off_t wxOutputStream::TellO() const { - return wxInvalidOffset; + return OnSysTell(); } off_t wxOutputStream::SeekO(off_t pos, wxSeekMode mode) { - return wxInvalidOffset; + return OnSysSeek(pos, mode); } void wxOutputStream::Sync() diff --git a/src/unix/gsocket.c b/src/unix/gsocket.c index cdc731c3b7..622f5e0681 100644 --- a/src/unix/gsocket.c +++ b/src/unix/gsocket.c @@ -626,7 +626,7 @@ if (socket->m_iocalls[event] && \ new_ival.it_interval.tv_sec = socket->m_timeout / 1000; \ new_ival.it_interval.tv_usec = (socket->m_timeout % 1000) * 1000; \ setitimer(ITIMER_REAL, &new_ival, &old_ival); \ - old_timer_sig = signal(SIGALRM, _GSocket_Timer); + old_timer_sig = signal(SIGALRM, SIG_DFL); #define DISABLE_TIMEOUT(socket) \ signal(SIGALRM, old_timer_sig); \