diff options
author | Po Lu <luangruo@yahoo.com> | 2022-05-05 13:44:19 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-05-05 13:44:19 +0800 |
commit | d15b11b50e92a13ebe90f28f3ac8791a1385edaf (patch) | |
tree | 35dc0c1357194bcf95e395434dcf0aeaf57ff4ac | |
parent | 01e874e1e6e6770ed0a5ba3ba7c9488494a2e61a (diff) | |
download | emacs-d15b11b50e92a13ebe90f28f3ac8791a1385edaf.tar.gz |
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.
-rw-r--r-- | src/xterm.c | 8 |
1 files changed, 8 insertions, 0 deletions
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 <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; |