]> git.eshelyaron.com Git - emacs.git/commitdiff
Use bswap_32 and bswap_16 in Motif DND code
authorPo Lu <luangruo@yahoo.com>
Thu, 5 May 2022 05:44:19 +0000 (13:44 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 5 May 2022 05:44:19 +0000 (13:44 +0800)
* src/xterm.c (SWAPCARD32, SAPCARD16): Use glibc/gnulib
byte-swapping functions if checking is disabled.

src/xterm.c

index 68ee63aea4ebed6cbbc6a797a20dfe660254bb6d..285b1d625e89910545160ed6aa29d2741bf60a25 100644 (file)
@@ -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;