diff options
| author | David Lamparter <equinox@diac24.net> | 2021-04-09 20:38:56 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2021-04-09 20:41:57 +0200 |
| commit | 0490ce41c133f9a801f36668dd58b326ec72a7aa (patch) | |
| tree | 51c85c94a7b7536e16dcb93bb3ca5ad14d4ffaff /pceplib | |
| parent | 636aad94735aff8aeec911bca4c32f4e5e48d77c (diff) | |
pceplib: add missing endian.h and config.h
endian.h supplies be*toh() and htobe*() functions. This fixes the build
on musl libc. On other systems it seems endian.h comes in transitively
from some other header.
(Also, all .c files should have config.h or zebra.h as the first
include, even if it works without that it's b0rked and only works due to
luck.)
Tested-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'pceplib')
| -rw-r--r-- | pceplib/pcep_msg_tlvs_encoding.c | 9 | ||||
| -rw-r--r-- | pceplib/test/pcep_msg_tlvs_test.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/pceplib/pcep_msg_tlvs_encoding.c b/pceplib/pcep_msg_tlvs_encoding.c index 967f138143..37f3353f76 100644 --- a/pceplib/pcep_msg_tlvs_encoding.c +++ b/pceplib/pcep_msg_tlvs_encoding.c @@ -25,6 +25,15 @@ * Encoding and decoding for PCEP Object TLVs. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef __FreeBSD__ +#include <sys/endian.h> +#else +#include <endian.h> +#endif /* __FreeBSD__ */ #include <stdlib.h> #include <string.h> diff --git a/pceplib/test/pcep_msg_tlvs_test.c b/pceplib/test/pcep_msg_tlvs_test.c index 6b650f6823..57e1d16e91 100644 --- a/pceplib/test/pcep_msg_tlvs_test.c +++ b/pceplib/test/pcep_msg_tlvs_test.c @@ -21,6 +21,15 @@ */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef __FreeBSD__ +#include <sys/endian.h> +#else +#include <endian.h> +#endif /* __FreeBSD__ */ #include <stdlib.h> #include <CUnit/CUnit.h> |
