From fdccfb1135cb9eb89a094c83c443c71b5bb125e2 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Sat, 1 Oct 2005 17:23:29 +0000 Subject: [PATCH] 0.9.5.16: Apparently FreeBSD 4 doesn't have putwc(), hence no boinkmarks for the last few days. Add putwc() detection to grovel-features.sh, and fallback to fputc() if putwc() isn't implemented. (Actually untested on FreeBSD, but I figure it can't get any worse). --- src/runtime/backtrace.c | 16 +++++++++++++++- src/runtime/linux-os.c | 2 +- tools-for-build/grovel-features.sh | 2 ++ tools-for-build/os-provides-putwc-test.c | 11 +++++++++++ version.lisp-expr | 2 +- 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tools-for-build/os-provides-putwc-test.c diff --git a/src/runtime/backtrace.c b/src/runtime/backtrace.c index f5515d5..07af8fe 100644 --- a/src/runtime/backtrace.c +++ b/src/runtime/backtrace.c @@ -406,6 +406,20 @@ debug_function_from_pc (struct code* code, void *pc) } static void +sbcl_putwc(wchar_t c, FILE *file) +{ +#ifdef LISP_FEATURE_OS_PROVIDES_PUTWC + putwc(c, file); +#else + if (c < 256) { + fputc(c, file); + } else { + fputc('?', file); + } +#endif +} + +static void print_string (lispobj *object) { int tag = widetag_of(*object); @@ -420,7 +434,7 @@ print_string (lispobj *object) wchar_t c = (wchar_t) data[i]; \ if (c == '\\' || c == '"') \ putchar('\\'); \ - putwc(c, stdout); \ + sbcl_putwc(c, stdout); \ } \ } while (0) diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 2e4e126..ce900a7 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -233,7 +233,7 @@ os_validate(os_vm_address_t addr, os_vm_size_t len) (unsigned long) len, addr, actual); return 0; } - + #ifdef LISP_FEATURE_ALPHA len=(len+(os_vm_page_size-1))&(~(os_vm_page_size-1)); diff --git a/tools-for-build/grovel-features.sh b/tools-for-build/grovel-features.sh index 935c099..4111fae 100644 --- a/tools-for-build/grovel-features.sh +++ b/tools-for-build/grovel-features.sh @@ -22,3 +22,5 @@ featurep() { featurep os-provides-dlopen featurep os-provides-dladdr + +featurep os-provides-putwc diff --git a/tools-for-build/os-provides-putwc-test.c b/tools-for-build/os-provides-putwc-test.c new file mode 100644 index 0000000..676f135 --- /dev/null +++ b/tools-for-build/os-provides-putwc-test.c @@ -0,0 +1,11 @@ +/* test to build and run so that we know if we have putwc */ + +#include +#include + +int main () +{ + wchar_t a = 'a'; + putwc(a, stdout); + return 104; +} diff --git a/version.lisp-expr b/version.lisp-expr index e181aa8..0877902 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.5.15" +"0.9.5.16" -- 1.7.10.4