Subject: Re: 27.0.50; Can't load/compile websocket in 32bit master

From: Paul Eggert <[email-masked]>
Date: Tue, 10 Apr 2018 15:41:17 -0700

I fixed that by installing the attached into ELPA.

I can't build ELPA from scratch on master now, for other reasons. The build 
fails as follows:

In toplevel form:
packages/counsel-ebdb/counsel-ebdb.el:29:1:Error: Cannot open load file: No such 
file or directory, ebdb
make: *** [GNUmakefile:171: packages/counsel-ebdb/counsel-ebdb.elc] Error 1

Is anybody building ELPA regularly? It looks like not.
From 76ee35ef60079bb6053e82e280274204a1b9fc70 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Tue, 10 Apr 2018 15:34:09 -0700
Subject: [PATCH] Port websocket to bleeding-edge 32-bit Emacs

Problem reported by Stefan Monnier (Bug#31118).
* packages/websocket/websocket.el (websocket-to-bytes):
Do not assume that #xffffffff is a valid fixnum.
---
 packages/websocket/websocket.el | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/packages/websocket/websocket.el b/packages/websocket/websocket.el
index 39a31c359..0533fb378 100644
--- a/packages/websocket/websocket.el
+++ b/packages/websocket/websocket.el
@@ -234,12 +234,9 @@ approximately 537M long."
            val nbytes))
   (if (= nbytes 8)
       (progn
-        (let ((hi-32bits (lsh val -32))
-              ;; Test for systems that don't have > 32 bits, and
-              ;; for those systems just return the value.
-              (low-32bits (if (= 0 (expt 2 32))
-                              val
-                            (logand #xffffffff val))))
+        (let* ((hi-32bits (lsh val -32))
+	       ;; This is just VAL on systems that don't have >= 32 bits.
+	       (low-32bits (- val (lsh hi-32bits 32))))
           (when (or (> hi-32bits 0) (> (lsh low-32bits -29) 0))
             (signal 'websocket-frame-too-large val))
           (bindat-pack `((:val vec 2 u32))
-- 
2.14.3