From d15b11b50e92a13ebe90f28f3ac8791a1385edaf Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 5 May 2022 13:44:19 +0800 Subject: [PATCH] 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. --- src/xterm.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.5