emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d15b11b50e: Use bswap_32 and bswap_16 in Motif DND code


From: Po Lu
Subject: master d15b11b50e: Use bswap_32 and bswap_16 in Motif DND code
Date: Thu, 5 May 2022 01:45:29 -0400 (EDT)

branch: master
commit d15b11b50e92a13ebe90f28f3ac8791a1385edaf
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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 68ee63aea4..285b1d625e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -618,6 +618,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include <sys/stat.h>
 #include <flexmember.h>
 #include <c-ctype.h>
+#include <byteswap.h>
 
 #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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]