aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-08 20:40:19 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-08 20:40:19 +0000
commit16a5290c91bc14ca3f3a26f24796761f9f08c0f0 (patch)
tree24f0c26663661a09e61563572ae3c07be408f8b3 /src
parenta90e0b91cdd543cc28abf425355c801279482ad6 (diff)
downloadopen-axiom-16a5290c91bc14ca3f3a26f24796761f9f08c0f0.tar.gz
Disable highlighting on Win32
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/msgdb.boot6
-rw-r--r--src/lib/cfuns-c.c19
3 files changed, 22 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f1f66376..b91d904a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2008-01-08 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/msgdb.boot (brightPrint0): Disable highlightinh on Win32.
+ * lib/cfuns-c.c (std_stream_is_terminal): Tidy.
+
+2008-01-08 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* boot/Makefile.pamphlet (AXIOM_LOCAL_LISP): Use Lisp image with C
bindings.
* interp/msgdb.boot (brightPrint0): Don't highlight if the
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index bfd8e1ff..ff40c6fd 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -654,13 +654,15 @@ brightPrint0 x ==
x = '"%%" =>
sayString '"%"
x = '"%b" =>
- NULL IS_-CONSOLE CUROUTSTREAM
+ -- FIXME: this kludge is GCL-specific. Find way to support
+ -- highlighting on all supported Lisp.
+ NULL IS_-CONSOLE CUROUTSTREAM or %hasFeature KEYWORD::WIN32
or stdStreamIsTerminal(1) = 0 => sayString '" "
NULL $highlightAllowed => sayString '" "
sayString $highlightFontOn
k := blankIndicator x => BLANKS k
x = '"%d" =>
- NULL IS_-CONSOLE CUROUTSTREAM
+ NULL IS_-CONSOLE CUROUTSTREAM or %hasFeature KEYWORD::WIN32
or stdStreamIsTerminal(1) = 0 => sayString '" "
NULL $highlightAllowed => sayString '" "
sayString $highlightFontOff
diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c
index f588beab..47485408 100644
--- a/src/lib/cfuns-c.c
+++ b/src/lib/cfuns-c.c
@@ -277,18 +277,25 @@ std_stream_is_terminal(int fd)
{
assert(fd > -1 && fd < 3);
#ifdef __WIN32__
- HANDLE handle;
+ DWORD handle;
switch (fd) {
case 0: handle = STD_INPUT_HANDLE; break;
case 1: handle = STD_OUTPUT_HANDLE; break;
case 2: handle = STD_ERROR_HANDLE; break;
}
- /* VerifyConsoleIoHandle appears to be an undocumented function.
- MS documentation suggests `GetFileType', but then the return
- value is still insufficient for determining whether the
- output stream is attached to a terminal or not. */
- return VerifyConsoleIoHandle(GetStdHandle(handle));
+ /* The MS documentation suggests `GetFileType' for determining
+ the nature of the file handle. The return value, in our case,
+ is an over approximation of what we are interested int: Are we
+ dealing with a stream connected to a terminal? The constant
+ FILE_TYPE_CHAR characterises character files; in particular
+ a console terminal, or a printer. There is an undocumented
+ function `VerifyConsoleIoHandle' to deal precisely with the case
+ we are interested in. However, while availale in Wine, it is
+ not available in the MinGW headers. Consequently, we cannot
+ rely on it for the moment.
+ So, we may still get garbage out of this function on MS platforms. */
+ return GetFileType(GetStdHandle(handle)) == FILE_TYPE_CHAR;
#else
return isatty(fd);
#endif