unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31118: 27.0.50; Can't load/compile websocket in 32bit master
@ 2018-04-10  3:03 Stefan Monnier
  2018-04-10 22:41 ` Paul Eggert
  0 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2018-04-10  3:03 UTC (permalink / raw)
  To: 31118

Package: Emacs
Version: 27.0.50


The websocket package available from GNU ELPA can't be used in a 32bit
build of master any more because of the #xffffffff constant in its code:

    (defun websocket-to-bytes (val nbytes)
      "Encode the integer VAL in NBYTES of data.
    NBYTES much be a power of 2, up to 8.
    
    This supports encoding values up to 536870911 bytes (2^29 - 1),
    approximately 537M long."
      (when (and (< nbytes 8)
                 (> val (expt 2 (* 8 nbytes))))
        ;; not a user-facing error, this must be caused from an error in
        ;; this library
        (error "websocket-to-bytes: Value %d could not be expressed in %d bytes"
               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))))
              (when (or (> hi-32bits 0) (> (lsh low-32bits -29) 0))
                (signal 'websocket-frame-too-large val))
              (bindat-pack `((:val vec 2 u32))
                           `((:val . [,hi-32bits ,low-32bits])))))
        (bindat-pack
         `((:val ,(cond ((= nbytes 1) 'u8)
                        ((= nbytes 2) 'u16)
                        ((= nbytes 4) 'u32)
                        ;; Library error, not system error
                        (t (error "websocket-to-bytes: Unknown NBYTES: %S" nbytes)))))
         `((:val . ,val)))))

The code used to compile&run correctly before both on 32bit and 64bit
systems (but admittedly, it failed to run correctly on 64bit systems
after having been compiled on a 32bit system).


        Stefan





^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-04-18 19:50 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-10  3:03 bug#31118: 27.0.50; Can't load/compile websocket in 32bit master Stefan Monnier
2018-04-10 22:41 ` Paul Eggert
2018-04-11  1:56   ` Stefan Monnier
2018-04-11  8:07     ` Paul Eggert
     [not found]       ` <mvmwoxe40f3.fsf@suse.de>
2018-04-11  8:35         ` Paul Eggert
2018-04-11 12:19       ` Stefan Monnier
2018-04-11 12:47         ` Basil L. Contovounesios
2018-04-11 16:22         ` Paul Eggert
2018-04-11 18:37           ` Stefan Monnier
2018-04-11 19:47             ` Glenn Morris
2018-04-15 22:11             ` Paul Eggert
2018-04-16  1:26               ` Stefan Monnier
2018-04-17  7:50                 ` Paul Eggert
2018-04-17 12:18                   ` Stefan Monnier
2018-04-17 23:53                     ` Paul Eggert
2018-04-18 12:22                       ` Stefan Monnier
2018-04-18 19:50                         ` Paul Eggert
2018-04-11 16:41         ` Eli Zaretskii
2018-04-11 18:38           ` Stefan Monnier
2018-04-12 12:50             ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).