0.9.5.16:
authorJuho Snellman <jsnell@iki.fi>
Sat, 1 Oct 2005 17:23:29 +0000 (17:23 +0000)
committerJuho Snellman <jsnell@iki.fi>
Sat, 1 Oct 2005 17:23:29 +0000 (17:23 +0000)
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
src/runtime/linux-os.c
tools-for-build/grovel-features.sh
tools-for-build/os-provides-putwc-test.c [new file with mode: 0644]
version.lisp-expr

index f5515d5..07af8fe 100644 (file)
@@ -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)
 
index 2e4e126..ce900a7 100644 (file)
@@ -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));
index 935c099..4111fae 100644 (file)
@@ -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 (file)
index 0000000..676f135
--- /dev/null
@@ -0,0 +1,11 @@
+/* test to build and run so that we know if we have putwc */
+
+#include <stdio.h>
+#include <wchar.h>
+
+int main ()
+{
+    wchar_t a = 'a';
+    putwc(a, stdout);
+    return 104;
+}
index e181aa8..0877902 100644 (file)
@@ -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"