Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update compat files. #136

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,9 @@ if(HAVE_GETOPT)
add_definitions(-DHAVE_GETOPT)
endif()

check_function_exists(ibuf_add_buf HAVE_IBUF_ADD_BUF)
if(HAVE_IBUF_ADD_BUF)
add_definitions(-DHAVE_IBUF_ADD_BUF)
endif()
check_function_exists(ibuf_add_zero HAVE_IBUF_ADD_ZERO)
if(HAVE_IBUF_ADD_ZERO)
add_definitions(-DHAVE_IBUF_ADD_ZERO)
endif()
check_function_exists(ibuf_data HAVE_IBUF_DATA)
if(HAVE_IBUF_DATA)
add_definitions(-DHAVE_IBUF_DATA)
check_function_exists(msgbuf_new_reader HAVE_MSGBUF_NEW_READER)
if(HAVE_MSGBUF_NEW_READER)
add_definitions(-DHAVE_MSGBUF_NEW_READER)
endif()

if(HAVE_VROUTE OR HAVE_VROUTE_NETLINK)
Expand Down
5 changes: 1 addition & 4 deletions compat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ endif()
if(NOT HAVE_GETOPT)
list(APPEND SRCS ${IKED_COMPAT}/getopt_long.c)
endif()
if(NOT HAVE_IMSG_H)
if(NOT HAVE_IMSG_H OR NOT HAVE_MSGBUF_NEW_READER)
list(APPEND SRCS
# imsg
${IKED_COMPAT}/imsg.c
Expand Down Expand Up @@ -73,9 +73,6 @@ endif()
if(NOT HAVE_VIS)
list(APPEND SRCS ${IKED_COMPAT}/vis.c)
endif()
if(NOT HAVE_IBUF_ADD_BUF OR NOT HAVE_IBUF_ADD_ZERO OR NOT HAVE_IBUF_DATA)
list(APPEND SRCS ${IKED_COMPAT}/ibuf-compat.c)
endif()

set(CFLAGS)
list(APPEND CFLAGS
Expand Down
6 changes: 6 additions & 0 deletions compat/endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#define htobe64(x) OSSwapHostToBigInt64(x)
#define letoh64(x) OSSwapLittleToHostInt64(x)
#define betoh64(x) OSSwapBigToHostInt64(x)
#define be16toh betoh16
#define be32toh betoh32
#define be64toh betoh64
#endif /* __APPLE__ && !HAVE_ENDIAN_H */

#if defined(_WIN32) && !defined(HAVE_ENDIAN_H)
Expand All @@ -30,6 +33,9 @@
#define htobe32(x) ntohl((x))
#define betoh64(x) ntohll((x))
#define htobe64(x) ntohll((x))
#define be16toh betoh16
#define be32toh betoh32
#define be64toh betoh64
#endif /* _WIN32 && !HAVE_ENDIAN_H */

#ifdef __linux__
Expand Down
76 changes: 0 additions & 76 deletions compat/ibuf-compat.c

This file was deleted.

Loading
Loading