From: Po Lu Date: Thu, 5 May 2022 05:44:19 +0000 (+0800) Subject: Use bswap_32 and bswap_16 in Motif DND code X-Git-Tag: emacs-29.0.90~1931^2~54 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d15b11b50e92a13ebe90f28f3ac8791a1385edaf;p=emacs.git Use bswap_32 and bswap_16 in Motif DND code * src/xterm.c (SWAPCARD32, SAPCARD16): Use glibc/gnulib byte-swapping functions if checking is disabled. --- diff --git a/src/xterm.c b/src/xterm.c index 68ee63aea4e..285b1d625e8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -618,6 +618,7 @@ along with GNU Emacs. If not, see . */ #include #include #include +#include #include "character.h" #include "coding.h" @@ -1054,6 +1055,8 @@ typedef enum xm_byte_order #endif } xm_byte_order; +#ifdef ENABLE_CHECKING + #define SWAPCARD32(l) \ { \ struct { unsigned t : 32; } bit32; \ @@ -1073,6 +1076,11 @@ typedef enum xm_byte_order s = bit16.t; \ } +#else +#define SWAPCARD32(l) bswap_32 (l) +#define SWAPCARD16(l) bswap_16 (l) +#endif + typedef struct xm_targets_table_header { /* BYTE */ uint8_t byte_order;