bug#40075: patch

2020-03-21 Thread Ludovic Courtès
Hi Matt,

Matt Wette  skribis:

> Below is a patch against guile-3.0.1.
>
> "make" works, "make check" works.
>
> null-threads.c was not seeing "SCM_USE_NULL_THREADS" so include
> libguile/scmconfig.h
> null-threads.c was not seeing def of SCM_API so include "libguile/scm.h"
> web-server.test used (if (provided? 'threads) ) so #undefined if
> no threads.

Perfect!  Pushed as 865d48058e6b1604b95a5da49334aaf80a6d6471 and
87bf38c93a7baa4f2c060c24d8e2d354f4771861 (slightly different).

Thank you!

Ludo’.





bug#40075: patch

2020-03-21 Thread Matt Wette

Below is a patch against guile-3.0.1.

"make" works, "make check" works.

null-threads.c was not seeing "SCM_USE_NULL_THREADS" so include 
libguile/scmconfig.h

null-threads.c was not seeing def of SCM_API so include "libguile/scm.h"
web-server.test used (if (provided? 'threads) ) so #undefined if 
no threads.



--- libguile/null-threads.h-orig    2020-03-21 08:12:37.852229565 -0700
+++ libguile/null-threads.h    2020-03-21 08:33:26.239759647 -0700
@@ -36,6 +36,8 @@
 #include 
 #include 

+#include "libguile/scm.h"
+
 /* Threads
 */
 typedef int scm_i_pthread_t;
--- libguile/null-threads.c-orig    2020-03-21 08:07:50.113439437 -0700
+++ libguile/null-threads.c    2020-03-21 08:08:32.681573253 -0700
@@ -23,6 +23,7 @@

 #include 

+#include "libguile/scmconfig.h"

 #if SCM_USE_NULL_THREADS
 #include "null-threads.h"
--- test-suite/tests/web-server.test-orig    2020-03-21 
09:29:57.688813542 -0700

+++ test-suite/tests/web-server.test    2020-03-21 09:35:08.850651216 -0700
@@ -93,25 +93,25 @@
 "not found"
   (expect http-get "/does-not-exist" 404))

-(pass-if-equal "GET with keep-alive"
-    '("Hello, λ world!"
-  "Écrit comme ça en Latin-1."
-  "GNU Guile")
-  (if (provided? 'threads)
+(if (provided? 'threads)
+    (pass-if-equal "GET with keep-alive"
+  '("Hello, λ world!"
+    "Écrit comme ça en Latin-1."
+    "GNU Guile")
   (let ((port (open-socket-for-uri %server-base-uri)))
-    (define result
-  (map (lambda (path)
- (let-values (((response body)
-   (http-get (string-append 
%server-base-uri path)

- #:port port
- #:keep-alive? #t
- #:headers
- '((user-agent . "GNU Guile")
-   (and (= (response-code response) 200)
-    body)))
-   '("/" "/latin1" "/user-agent")))
-    (close-port port)
-    result)))
+    (define result
+      (map (lambda (path)
+         (let-values (((response body)
+               (http-get (string-append %server-base-uri path)
+                     #:port port
+                     #:keep-alive? #t
+                     #:headers
+                     '((user-agent . "GNU Guile")
+           (and (= (response-code response) 200)
+            body)))
+       '("/" "/latin1" "/user-agent")))
+    (close-port port)
+    result)))

 (pass-if-equal "POST /"
 "forbidden"