From 27a54379cf3c48ff63c02a4a9f023297bba60d45 Mon Sep 17 00:00:00 2001 From: Noel Kuntze Date: Mon, 12 Jul 2021 01:29:43 +0200 Subject: [PATCH 900/904] src: Patch for building with musl on openwrt (taken verbatim from openwrt package sources) --- .../kernel_netlink/kernel_netlink_ipsec.c | 1 + .../kernel_netlink/kernel_netlink_net.c | 2 + .../kernel_netlink/kernel_netlink_shared.c | 2 + src/libstrongswan/library.h | 1 + src/libstrongswan/musl.h | 38 +++++++++++++++++++ .../plugins/bliss/bliss_huffman.c | 2 + 6 files changed, 46 insertions(+) create mode 100644 src/libstrongswan/musl.h --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c @@ -41,6 +41,7 @@ */ #define _GNU_SOURCE +#include #include #include #include --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c @@ -37,6 +37,8 @@ * THE SOFTWARE. */ +#include "musl.h" + #include #include #include --- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c +++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_shared.c @@ -37,6 +37,8 @@ * THE SOFTWARE. */ +#include "musl.h" + #include #include #include --- a/src/libstrongswan/library.h +++ b/src/libstrongswan/library.h @@ -120,6 +120,7 @@ #include "utils/leak_detective.h" #include "plugins/plugin_loader.h" #include "settings/settings.h" +#include "musl.h" typedef struct library_t library_t; --- /dev/null +++ b/src/libstrongswan/musl.h @@ -0,0 +1,38 @@ +#include + +#define crypt x_crypt +#define encrypt x_encrypt +#include + +#define fd_set x_fd_set +#define ino_t x_ino_t +#define off_t x_off_t +#define loff_t x_loff_t +#define dev_t x_dev_t +#define mode_t x_mode_t +#define uid_t x_uid_t +#define gid_t x_gid_t +#define uint64_t x_uint64_t +#define u_int64_t x_u_int64_t +#define int64_t x_int64_t +#define nlink_t x_nlink_t +#define timer_t x_timer_t +#define blkcnt_t x_blkcnt_t + +#include + +#undef fd_set +#undef ino_t +#undef off_t +#undef dev_t +#undef mode_t +#undef uid_t +#undef gid_t +#undef uint64_t +#undef u_int64_t +#undef int64_t +#undef nlink_t +#undef timer_t +#undef blkcnt_t +#undef crypt +#undef encrypt --- a/src/libstrongswan/plugins/bliss/bliss_huffman.c +++ b/src/libstrongswan/plugins/bliss/bliss_huffman.c @@ -18,6 +18,8 @@ #include "bliss_param_set.h" #include +#undef fprintf +#undef printf #include #include