From 4f06c71212edaa364a17afb82ec352a1c960a498 Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Tue, 17 Nov 2009 17:27:40 +0000 Subject: * unix/tclUnixChan.c (TtyParseMode): Partial undo of Donal's tidy- up from a few days ago (2009-11-9, not in ChangeLog). strchr is apparently a macro on AIX and reacts badly to pre-processor directives in its arguments. --- ChangeLog | 7 +++++++ unix/tclUnixChan.c | 14 +++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0dcbf3f..c3fe2f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-11-17 Andreas Kupries + + * unix/tclUnixChan.c (TtyParseMode): Partial undo of Donal's tidy- + up from a few days ago (2009-11-9, not in ChangeLog). strchr is + apparently a macro on AIX and reacts badly to pre-processor + directives in its arguments. + 2009-11-16 Alexandre Ferrieux * generic/tclEncoding.c: (forward port) Fix [Bug 2891556] and improve diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 323d9e2..aaca9f4 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.102 2009/11/09 13:47:23 dkf Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.103 2009/11/17 17:27:40 andreas_kupries Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -1390,15 +1390,19 @@ TtyParseMode( /* * Only allow setting mark/space parity on platforms that support it Make * sure to allow for the case where strchr is a macro. [Bug: 5089] + * + * We cannot if/else/endif the strchr arguments, it has to be the whole + * function. On AIX this function is apparently a macro, and macros do + * not allow pre-processor directives in their arguments. */ - if (strchr( + if ( #if defined(PAREXT) || defined(USE_TERMIO) - "noems", + strchr("noems", parity) #else - "noe", + strchr("noe", parity) #endif /* PAREXT|USE_TERMIO */ - parity) == NULL) { + == NULL) { if (interp != NULL) { Tcl_AppendResult(interp, bad, " parity: should be ", #if defined(PAREXT) || defined(USE_TERMIO) -- cgit v0.12