Fixes to compile on solaris 9 using g++.

This commit is contained in:
crs 2004-05-01 10:12:06 +00:00
parent dcfe49ef48
commit 165c889c5d
4 changed files with 19 additions and 6 deletions

View File

@ -515,12 +515,13 @@ else
fi fi
])dnl ACX_PTHREAD ])dnl ACX_PTHREAD
dnl enable maximum compiler warnings dnl enable maximum compiler warnings. must ignore unknown pragmas to
dnl build on solaris.
dnl we only know how to do this for g++ dnl we only know how to do this for g++
AC_DEFUN([ACX_CXX_WARNINGS], [ AC_DEFUN([ACX_CXX_WARNINGS], [
AC_MSG_CHECKING([for C++ compiler warning flags]) AC_MSG_CHECKING([for C++ compiler warning flags])
if test "$GXX" = "yes"; then if test "$GXX" = "yes"; then
acx_cxx_warnings="-Wall" acx_cxx_warnings="-Wall -Wno-unknown-pragmas"
fi fi
if test -n "$acx_cxx_warnings"; then if test -n "$acx_cxx_warnings"; then
CXXFLAGS="$CXXFLAGS $acx_cxx_warnings" CXXFLAGS="$CXXFLAGS $acx_cxx_warnings"

View File

@ -35,19 +35,17 @@ case $host in
*-*-mingw32* | *-*-windows*) *-*-mingw32* | *-*-windows*)
acx_host_arch="WIN32" acx_host_arch="WIN32"
acx_host_winapi="MSWINDOWS" acx_host_winapi="MSWINDOWS"
ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_WIN32=1 -DWINAPI_MSWINDOWS=1"
;; ;;
*-*-darwin*) *-*-darwin*)
acx_host_arch="UNIX" acx_host_arch="UNIX"
acx_host_winapi="CARBON" acx_host_winapi="CARBON"
ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_UNIX=1 -DWINAPI_CARBON=1"
;; ;;
*) *)
acx_host_arch="UNIX" acx_host_arch="UNIX"
acx_host_winapi="XWINDOWS" acx_host_winapi="XWINDOWS"
ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_UNIX=1 -DWINAPI_XWINDOWS=1"
;; ;;
esac esac
ARCH_CFLAGS="$ARCH_CFLAGS -DSYSAPI_$acx_host_arch=1 -DWINAPI_$acx_host_winapi=1"
AM_CONDITIONAL(WIN32, test x$acx_host_arch = xWIN32) AM_CONDITIONAL(WIN32, test x$acx_host_arch = xWIN32)
AM_CONDITIONAL(UNIX, test x$acx_host_arch = xUNIX) AM_CONDITIONAL(UNIX, test x$acx_host_arch = xUNIX)
AM_CONDITIONAL(MSWINDOWS, test x$acx_host_winapi = xMSWINDOWS) AM_CONDITIONAL(MSWINDOWS, test x$acx_host_winapi = xMSWINDOWS)
@ -85,7 +83,7 @@ ACX_CHECK_INET_ATON
dnl checks for header files dnl checks for header files
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([unistd.h sys/time.h sys/types.h wchar.h]) AC_CHECK_HEADERS([unistd.h sys/time.h sys/types.h wchar.h alloca.h])
AC_CHECK_HEADERS([sys/socket.h sys/select.h]) AC_CHECK_HEADERS([sys/socket.h sys/select.h])
AC_CHECK_HEADERS([istream ostream sstream]) AC_CHECK_HEADERS([istream ostream sstream])
AC_HEADER_TIME AC_HEADER_TIME

View File

@ -34,6 +34,9 @@
#if HAVE_POLL #if HAVE_POLL
# include <sys/poll.h> # include <sys/poll.h>
# if HAVE_ALLOCA_H
# include <alloca.h>
# endif
#else #else
# if HAVE_SYS_SELECT_H # if HAVE_SYS_SELECT_H
# include <sys/select.h> # include <sys/select.h>
@ -43,6 +46,13 @@
# endif # endif
#endif #endif
#if HAVE_ALLOCA_H
# define freea(x_)
#else
# define alloca(x_) malloc(x_)
# define freea(x_) free(x_)
#endif
static const int s_family[] = { static const int s_family[] = {
PF_UNSPEC, PF_UNSPEC,
PF_INET PF_INET
@ -327,8 +337,10 @@ CArchNetworkBSD::pollSocket(CPollEntry pe[], int num, double timeout)
if (errno == EINTR) { if (errno == EINTR) {
// interrupted system call // interrupted system call
ARCH->testCancelThread(); ARCH->testCancelThread();
freea(pfd);
return 0; return 0;
} }
freea(pfd);
throwError(errno); throwError(errno);
} }
@ -349,6 +361,7 @@ CArchNetworkBSD::pollSocket(CPollEntry pe[], int num, double timeout)
} }
} }
freea(pfd);
return n; return n;
} }

View File

@ -27,6 +27,7 @@
#endif #endif
#if defined(HAVE_X11_EXTENSIONS_DPMS_H) #if defined(HAVE_X11_EXTENSIONS_DPMS_H)
extern "C" { extern "C" {
# include <X11/Xmd.h>
# include <X11/extensions/dpms.h> # include <X11/extensions/dpms.h>
} }
#endif #endif