From 15ca3312c069526b7f2207de9dfb9b9e851caf95 Mon Sep 17 00:00:00 2001 From: Aaron Zang Date: Mon, 14 Dec 2009 17:55:46 -0800 Subject: [PATCH 1/5] Solaris: Avoid switching to inactive VT's Fix for OpenSolaris bug 6876992: "[vconsole] Ctrl+Alt+F12 switchs to blank console screen with hotkeys property turned-off" http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6876992 Xorg needs to do sanity test for the VT it is commanded to switch to. If the VT is not opened by any process, discard the switching request. The changes also contain the fix for some flaws discovered when getting the new gdm to run. Signed-off-by: Aaron Zang Signed-off-by: Alan Coopersmith --- hw/xfree86/common/xf86Events.c | 10 +++++++- hw/xfree86/os-support/solaris/sun_VTsw.c | 30 ++++++++++++++++++------ hw/xfree86/os-support/solaris/sun_init.c | 19 ++++++++++----- 3 files changed, 45 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 8cd765a1c..8e6a15be8 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -202,8 +202,16 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) vtno--; #endif #if defined(sun) - if (vtno == xf86Info.vtno) + if (vtno == xf86Info.vtno) { break; + } else { + struct vt_stat state; + if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0) + break; + + if ((state.v_state & (1 << vtno)) == 0) + break; + } xf86Info.vtRequestsPending = TRUE; xf86Info.vtPendingNum = vtno; diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c index ded2f271e..7f4e08e1e 100644 --- a/hw/xfree86/os-support/solaris/sun_VTsw.c +++ b/hw/xfree86/os-support/solaris/sun_VTsw.c @@ -38,17 +38,27 @@ * Handle the VT-switching interface for Solaris/OpenSolaris */ -void -xf86VTRequest(int sig) -{ - if (xf86Info.vtPendingNum != -1) - { - ioctl(xf86Info.consoleFd, VT_RELDISP, 1); - xf86Info.vtPendingNum = -1; +static int xf86VTPruneDoor = 0; +void +xf86VTRelease(int sig) +{ + if (xf86Info.vtPendingNum == -1) + { + xf86VTPruneDoor = 1; + xf86Info.vtRequestsPending = TRUE; return; } + ioctl(xf86Info.consoleFd, VT_RELDISP, 1); + xf86Info.vtPendingNum = -1; + + return; +} + +void +xf86VTAcquire(int sig) +{ xf86Info.vtRequestsPending = TRUE; return; } @@ -68,6 +78,12 @@ xf86VTSwitchAway(void) xf86Info.vtRequestsPending = FALSE; + if (xf86VTPruneDoor) { + xf86VTPruneDoor = 0; + ioctl(xf86Info.consoleFd, VT_RELDISP, 1); + return (TRUE); + } + vt_door_arg.vt_ev = VT_EV_HOTKEYS; vt_door_arg.vt_num = xf86Info.vtPendingNum; door_arg.data_ptr = (char *)&vt_door_arg; diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c index 2c569f02c..5846866a2 100644 --- a/hw/xfree86/os-support/solaris/sun_init.c +++ b/hw/xfree86/os-support/solaris/sun_init.c @@ -39,6 +39,8 @@ static Bool Protect0 = FALSE; static int VTnum = -1; static int xf86StartVT = -1; static int vtEnabled = 0; +extern void xf86VTAcquire(int); +extern void xf86VTRelease(int); #endif /* Device to open as xf86Info.consoleFd */ @@ -137,7 +139,8 @@ xf86OpenConsole(void) else { if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) || - (xf86Info.vtno == -1)) { + (xf86Info.vtno == -1)) + { FatalError("xf86OpenConsole: Cannot find a free VT\n"); } } @@ -146,7 +149,8 @@ xf86OpenConsole(void) snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno); } - if (fd != -1) { + if (fd != -1) + { close(fd); } @@ -178,11 +182,12 @@ xf86OpenConsole(void) if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) FatalError("xf86OpenConsole: VT_GETMODE failed\n"); - OsSignal(SIGUSR1, xf86VTRequest); + OsSignal(SIGUSR1, xf86VTAcquire); + OsSignal(SIGUSR2, xf86VTRelease); VT.mode = VT_PROCESS; - VT.relsig = SIGUSR1; VT.acqsig = SIGUSR1; + VT.relsig = SIGUSR2; if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0) FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n"); @@ -204,7 +209,8 @@ xf86OpenConsole(void) else /* serverGeneration != 1 */ { #ifdef HAS_USL_VTS - if (vtEnabled) { + if (vtEnabled) + { /* * Now re-get the VT */ @@ -285,7 +291,8 @@ xf86CloseConsole(void) #endif #ifdef HAS_USL_VTS - if (vtEnabled == 1) { + if (vtEnabled) + { if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1) { VT.mode = VT_AUTO; /* Set default vt handling */ From 39ab474197bdad7d8e9ef496df2d61cbea39d370 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 15 Dec 2009 19:07:38 -0800 Subject: [PATCH 2/5] Move OS-specific VT key handler code from common to os-support Adds new function xf86Activate to the OS-specific *VTsw*.c files and calls it from xf86ProcessActionEvent Signed-off-by: Alan Coopersmith Tested-by: Tiago Vignatti (GNU/Linux) --- hw/xfree86/common/xf86Events.c | 53 +++++++++--------------- hw/xfree86/os-support/bsd/bsd_VTsw.c | 9 ++++ hw/xfree86/os-support/sco/VTsw_sco.c | 10 +++++ hw/xfree86/os-support/shared/VTsw_noop.c | 6 +++ hw/xfree86/os-support/shared/VTsw_usl.c | 11 +++++ hw/xfree86/os-support/solaris/sun_VTsw.c | 17 ++++++++ hw/xfree86/os-support/xf86_OSproc.h | 1 + 7 files changed, 73 insertions(+), 34 deletions(-) diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 8e6a15be8..ebf03bfe7 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -194,55 +194,40 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) if (!xf86Info.dontZoom) xf86ZoomViewport(xf86Info.currentScreen, -1); break; -#if defined(VT_ACTIVATE) case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { int vtno = *((int *) arg); -#if defined(__SCO__) || defined(__UNIXWARE__) - vtno--; -#endif -#if defined(sun) - if (vtno == xf86Info.vtno) { - break; - } else { - struct vt_stat state; - if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0) - break; - if ((state.v_state & (1 << vtno)) == 0) - break; + if (vtno != xf86Info.vtno) { + if (!xf86VTActivate(vtno)) { + ErrorF("Failed to switch from vt%02d to vt%02d: %s\n", + xf86Info.vtno, vtno, strerror(errno)); + } } - - xf86Info.vtRequestsPending = TRUE; - xf86Info.vtPendingNum = vtno; -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); -#endif } break; case ACTION_SWITCHSCREEN_NEXT: if (VTSwitchEnabled && !xf86Info.dontVTSwitch) { -#if defined(__SCO__) || defined(__UNIXWARE__) - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0) -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno + 1) < 0) -#endif -#if defined (__SCO__) || (defined(sun) && defined (__i386__) && defined (SVR4)) || defined(__UNIXWARE__) - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 0) < 0) -#else - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) < 0) -#endif - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); + if (!xf86VTActivate(xf86Info.vtno + 1)) { + /* If first try failed, assume this is the last VT and + * try wrapping around to the first vt. + */ + if (!xf86VTActivate(1)) { + ErrorF("Failed to switch from vt%02d to next vt: %s\n", + xf86Info.vtno, strerror(errno)); + } + } } break; case ACTION_SWITCHSCREEN_PREV: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && xf86Info.vtno > 0) { - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno - 1) < 0) - ErrorF("Failed to switch consoles (%s)\n", strerror(errno)); + if (!xf86VTActivate(xf86Info.vtno - 1)) { + /* Don't know what the maximum VT is, so can't wrap around */ + ErrorF("Failed to switch from vt%02d to previous vt: %s\n", + xf86Info.vtno, strerror(errno)); + } } break; -#endif default: break; } diff --git a/hw/xfree86/os-support/bsd/bsd_VTsw.c b/hw/xfree86/os-support/bsd/bsd_VTsw.c index 476a0e957..4842be5c9 100644 --- a/hw/xfree86/os-support/bsd/bsd_VTsw.c +++ b/hw/xfree86/os-support/bsd/bsd_VTsw.c @@ -92,3 +92,12 @@ xf86VTSwitchTo() #endif return(TRUE); } + +Bool +xf86VTActivate(int vtno) +{ + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { + return(FALSE); + } + return(TRUE); +} diff --git a/hw/xfree86/os-support/sco/VTsw_sco.c b/hw/xfree86/os-support/sco/VTsw_sco.c index d126e7869..0a59fb965 100644 --- a/hw/xfree86/os-support/sco/VTsw_sco.c +++ b/hw/xfree86/os-support/sco/VTsw_sco.c @@ -115,3 +115,13 @@ xf86VTSwitchTo(void) return TRUE; } } + +Bool +xf86VTActivate(int vtno) +{ + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno - 1) < 0) { + return(FALSE); + } + + return(TRUE); +} diff --git a/hw/xfree86/os-support/shared/VTsw_noop.c b/hw/xfree86/os-support/shared/VTsw_noop.c index 78cbe0e34..3425840a2 100644 --- a/hw/xfree86/os-support/shared/VTsw_noop.c +++ b/hw/xfree86/os-support/shared/VTsw_noop.c @@ -52,3 +52,9 @@ xf86VTSwitchTo(void) { return(TRUE); } + +Bool +xf86VTActivate(int vtno) +{ + return(TRUE); +} diff --git a/hw/xfree86/os-support/shared/VTsw_usl.c b/hw/xfree86/os-support/shared/VTsw_usl.c index 9308640e2..393f1c0b9 100644 --- a/hw/xfree86/os-support/shared/VTsw_usl.c +++ b/hw/xfree86/os-support/shared/VTsw_usl.c @@ -88,3 +88,14 @@ xf86VTSwitchTo(void) return(TRUE); } } + +Bool +xf86VTActivate(int vtno) +{ +#ifdef VT_ACTIVATE + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, vtno) < 0) { + return(FALSE); + } +#endif + return(TRUE); +} diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c index 7f4e08e1e..1e2774b11 100644 --- a/hw/xfree86/os-support/solaris/sun_VTsw.c +++ b/hw/xfree86/os-support/solaris/sun_VTsw.c @@ -118,3 +118,20 @@ xf86VTSwitchTo(void) return(TRUE); } } + +Bool +xf86VTActivate(int vtno) +{ + struct vt_stat state; + + if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0) + return(FALSE); + + if ((state.v_state & (1 << vtno)) == 0) + return(FALSE); + + xf86Info.vtRequestsPending = TRUE; + xf86Info.vtPendingNum = vtno; + + return(TRUE); +} diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h index c1a117334..f0cb768be 100644 --- a/hw/xfree86/os-support/xf86_OSproc.h +++ b/hw/xfree86/os-support/xf86_OSproc.h @@ -199,6 +199,7 @@ extern _X_EXPORT Bool xf86SIGIOSupported (void); typedef void (*PMClose)(void); extern _X_EXPORT void xf86OpenConsole(void); extern _X_EXPORT void xf86CloseConsole(void); +extern _X_HIDDEN Bool xf86VTActivate(int vtno); extern _X_EXPORT Bool xf86VTSwitchPending(void); extern _X_EXPORT Bool xf86VTSwitchAway(void); extern _X_EXPORT Bool xf86VTSwitchTo(void); From 79e7b0b875634d0f9e1a95232a4e38adf617bc14 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 16 Jan 2010 10:45:32 -0800 Subject: [PATCH 3/5] Only enable kdrive input drivers on Linux by default Fixes build on non-Linux platforms by restoring the defaults to where they were before commit 6c2b3a4247d10a50699ffa6abb643c5e959eefa8, to only enable the Linux kbd, mouse & evdev drivers when building on Linux platforms. Signed-off-by: Alan Coopersmith Reviewed-by: Mikhail Gusarov Reviewed-by: Peter Hutterer --- configure.ac | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 8c1085b29..a18745288 100644 --- a/configure.ac +++ b/configure.ac @@ -641,9 +641,9 @@ AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdriv AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) dnl kdrive options -AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: enabled)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=yes]) -AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: enabled)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=yes]) -AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: enabled)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=yes]) +AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) +AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) +AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) dnl chown/chmod to be setuid root as part of build @@ -1995,9 +1995,6 @@ XEPHYR_LIBS= XEPHYR_INCS= AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) -AM_CONDITIONAL(KDRIVE_KBD, test "x$KDRIVE_KBD" = xyes) -AM_CONDITIONAL(KDRIVE_EVDEV, test "x$KDRIVE_EVDEV" = xyes) -AM_CONDITIONAL(KDRIVE_MOUSE, test "x$KDRIVE_MOUSE" = xyes) if test "$KDRIVE" = yes; then AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) @@ -2072,6 +2069,26 @@ if test "$KDRIVE" = yes; then *linux*) KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' KDRIVELINUX=yes + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=yes + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=yes + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=yes + fi + ;; + *) + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=no + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=no + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=no + fi ;; esac KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' @@ -2090,6 +2107,9 @@ AC_SUBST([KDRIVE_PURE_LIBS]) AC_SUBST([KDRIVE_LOCAL_LIBS]) AC_SUBST([KDRIVE_LIBS]) AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) +AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) +AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) +AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes]) AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) From 138d4c1670ebab435bf00627c97098a3a54b81a6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 16 Jan 2010 21:03:00 -0800 Subject: [PATCH 4/5] glx: Sun compilers now support some gcc __attribute__ values Sun cc 5.9 and later (__SUNPRO_C >= 0x590) support __attribute__ calls for aligned, always_inline, noinline, pure, const, and malloc. This commit consists of the related updates to files that were regenerated by gl_XML.py in mesa after adding the __SUNPRO_C checks to it Signed-off-by: Alan Coopersmith Signed-off-by: Brian Paul --- glx/glapitemp.h | 2 +- glx/indirect_dispatch.h | 2 +- glx/indirect_reqsize.h | 4 ++-- glx/indirect_size.h | 4 ++-- glx/indirect_size_get.c | 4 ++-- glx/indirect_size_get.h | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/glx/glapitemp.h b/glx/glapitemp.h index 09259f470..ddd67afec 100644 --- a/glx/glapitemp.h +++ b/glx/glapitemp.h @@ -27,7 +27,7 @@ */ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/glx/indirect_dispatch.h b/glx/indirect_dispatch.h index 014e417c9..6cc322c24 100644 --- a/glx/indirect_dispatch.h +++ b/glx/indirect_dispatch.h @@ -28,7 +28,7 @@ #if !defined( _INDIRECT_DISPATCH_H_ ) # define _INDIRECT_DISPATCH_H_ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN diff --git a/glx/indirect_reqsize.h b/glx/indirect_reqsize.h index 26211ee5c..05ad5913f 100644 --- a/glx/indirect_reqsize.h +++ b/glx/indirect_reqsize.h @@ -28,13 +28,13 @@ #if !defined( _INDIRECT_REQSIZE_H_ ) # define _INDIRECT_REQSIZE_H_ -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define HIDDEN __attribute__((visibility("hidden"))) # else # define HIDDEN # endif -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE diff --git a/glx/indirect_size.h b/glx/indirect_size.h index 9ba0bd690..af0919f96 100644 --- a/glx/indirect_size.h +++ b/glx/indirect_size.h @@ -36,7 +36,7 @@ * \author Ian Romanick */ -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -48,7 +48,7 @@ # define FASTCALL # endif -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/glx/indirect_size_get.c b/glx/indirect_size_get.c index 80f81dec6..475aa58ee 100644 --- a/glx/indirect_size_get.c +++ b/glx/indirect_size_get.c @@ -32,7 +32,7 @@ #include "indirect_util.h" #include "indirect_size.h" -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -44,7 +44,7 @@ # define FASTCALL # endif -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL diff --git a/glx/indirect_size_get.h b/glx/indirect_size_get.h index 4fcb55b4e..378baa673 100644 --- a/glx/indirect_size_get.h +++ b/glx/indirect_size_get.h @@ -36,7 +36,7 @@ * \author Ian Romanick */ -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define PURE __attribute__((pure)) # else # define PURE @@ -48,7 +48,7 @@ # define FASTCALL # endif -# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) +# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))) && defined(__ELF__) # define INTERNAL __attribute__((visibility("internal"))) # else # define INTERNAL From 837bd2bbc02b893f96861b48c1f02b7b8e7e3e48 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 16 Oct 2009 22:32:15 -0700 Subject: [PATCH 5/5] Remove unbalanced ( from failure to move log error Signed-off-by: Alan Coopersmith Reviewed-by: Dan Nicholson --- os/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/log.c b/os/log.c index 08fa1f229..e20b6d357 100644 --- a/os/log.c +++ b/os/log.c @@ -187,7 +187,7 @@ LogInit(const char *fname, const char *backup) sprintf(oldLog, "%s%s", logFileName, suffix); free(suffix); if (rename(logFileName, oldLog) == -1) { - FatalError("Cannot move old log file (\"%s\" to \"%s\"\n", + FatalError("Cannot move old log file \"%s\" to \"%s\"\n", logFileName, oldLog); } free(oldLog);