Skip to content

Commit b27fb15

Browse files
committed
fixup! lyb BUGFIX missing header file on mac osx
1 parent 03c489e commit b27fb15

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/parser_lyb.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818
#include <string.h>
1919
#include <inttypes.h>
2020
#ifdef __APPLE__
21-
# include <machine/endian.h>
21+
# include <libkern/OSByteOrder.h>
22+
23+
# define le16toh(x) OSSwapLittleToHostInt16(x)
24+
# define le32toh(x) OSSwapLittleToHostInt32(x)
25+
# define le64toh(x) OSSwapLittleToHostInt64(x)
2226
#else
23-
# include <endian.h>
27+
# include <endian.h>
2428
#endif
2529

2630
#include "libyang.h"

src/printer_lyb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#include <assert.h>
2020
#include <stdint.h>
2121
#ifdef __APPLE__
22-
# include <machine/endian.h>
22+
# include <libkern/OSByteOrder.h>
23+
# define htole64(x) OSSwapHostToLittleInt64(x)
2324
#else
24-
# include <endian.h>
25+
# include <endian.h>
2526
#endif
2627

2728
#include "common.h"

0 commit comments

Comments
 (0)