2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Define WORDS_BIGENDIAN on big endian systems.

Instead of a configure check, we use endian.h (or a fallback).
This commit is contained in:
Todd C. Miller
2022-06-03 12:51:21 -06:00
parent 71c07579ba
commit ac06fb7f29

View File

@@ -49,9 +49,22 @@
#include <stdlib.h> /* for malloc, free */
#include <string.h> /* for strcmp, strlen, memcpy, memmove, memset */
#if defined(HAVE_ENDIAN_H)
# include <endian.h>
#elif defined(HAVE_SYS_ENDIAN_H)
# include <sys/endian.h>
#elif defined(HAVE_MACHINE_ENDIAN_H)
# include <machine/endian.h>
#else
# include "compat/endian.h"
#endif
#include "protobuf-c/protobuf-c.h"
#if BYTE_ORDER == BIG_ENDIAN
# define WORDS_BIGENDIAN
#endif
#define TRUE 1
#define FALSE 0