From 42ddcf71e58300c7b594ac3964977625355cb24c Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 4 Nov 2023 08:30:31 +0000 Subject: [PATCH] *: Remove APPLE #defines from build We cannot build on apple machines at all due to our usage of some gcc extensions that will probably never see the light of day again. Signed-off-by: Donald Sharp --- configure.ac | 3 --- lib/event.c | 5 ----- lib/ntop.c | 2 +- lib/sockopt.c | 13 ++++++------- lib/zebra.h | 11 +++-------- lib/zlog.c | 3 --- zebra/kernel_socket.c | 6 +----- 7 files changed, 11 insertions(+), 32 deletions(-) diff --git a/configure.ac b/configure.ac index 9985cdcbf8..12cb4b9bb3 100644 --- a/configure.ac +++ b/configure.ac @@ -1180,9 +1180,6 @@ m4_define([FRR_INCLUDES], /* Required for MAXSIG */ #include #include -#ifdef __APPLE__ -# define __APPLE_USE_RFC_3542 -#endif #include #include #include diff --git a/lib/event.c b/lib/event.c index d3bc0205ae..4121c0a448 100644 --- a/lib/event.c +++ b/lib/event.c @@ -55,11 +55,6 @@ static int event_timer_cmp(const struct event *a, const struct event *b) DECLARE_HEAP(event_timer_list, struct event, timeritem, event_timer_cmp); -#if defined(__APPLE__) -#include -#include -#endif - #define AWAKEN(m) \ do { \ const unsigned char wakebyte = 0x01; \ diff --git a/lib/ntop.c b/lib/ntop.c index 49e1b152c9..89b4d5ecdc 100644 --- a/lib/ntop.c +++ b/lib/ntop.c @@ -158,7 +158,7 @@ inet4: return dst; } -#if !defined(INET_NTOP_NO_OVERRIDE) && !defined(__APPLE__) +#if !defined(INET_NTOP_NO_OVERRIDE) /* we want to override libc inet_ntop, but make sure it shows up in backtraces * as frr_inet_ntop (to avoid confusion while debugging) */ diff --git a/lib/sockopt.c b/lib/sockopt.c index 0c4adb0b7c..ed681710e5 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -10,13 +10,12 @@ #include "sockunion.h" #include "lib_errors.h" -#if (defined(__FreeBSD__) \ - && ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) \ - || (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) \ - || (defined(__NetBSD__) && defined(__NetBSD_Version__) \ - && __NetBSD_Version__ >= 106010000) \ - || defined(__OpenBSD__) || defined(__APPLE__) \ - || defined(__DragonFly__) || defined(__sun) +#if (defined(__FreeBSD__) && \ + ((__FreeBSD_version >= 500022 && __FreeBSD_version < 700000) || \ + (__FreeBSD_version < 500000 && __FreeBSD_version >= 440000))) || \ + (defined(__NetBSD__) && defined(__NetBSD_Version__) && \ + __NetBSD_Version__ >= 106010000) || \ + defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun) #define HAVE_BSD_STRUCT_IP_MREQ_HACK #endif diff --git a/lib/zebra.h b/lib/zebra.h index 3fe61c801e..378ccd84d0 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -76,10 +76,6 @@ #include #endif /* HAVE_SYS_SOCKIO_H */ -#ifdef __APPLE__ -#define __APPLE_USE_RFC_3542 -#endif - #ifndef HAVE_LIBCRYPT #ifdef HAVE_LIBCRYPTO #include @@ -280,10 +276,9 @@ struct in_pktinfo { * OpenBSD: network byte order, apart from older versions which are as per * *BSD */ -#if defined(__NetBSD__) \ - || (defined(__FreeBSD__) && (__FreeBSD_version < 1100030)) \ - || (defined(__OpenBSD__) && (OpenBSD < 200311)) \ - || (defined(__APPLE__)) +#if defined(__NetBSD__) || \ + (defined(__FreeBSD__) && (__FreeBSD_version < 1100030)) || \ + (defined(__OpenBSD__) && (OpenBSD < 200311)) #define HAVE_IP_HDRINCL_BSD_ORDER #endif diff --git a/lib/zlog.c b/lib/zlog.c index 309a955fa9..2a6189573f 100644 --- a/lib/zlog.c +++ b/lib/zlog.c @@ -32,9 +32,6 @@ #ifdef __DragonFly__ #include #endif -#ifdef __APPLE__ -#include -#endif #ifdef HAVE_LIBUNWIND #define UNW_LOCAL_ONLY diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index d897f4a1df..62adbc0c3e 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -48,11 +48,7 @@ extern struct zebra_privs_t zserv_privs; * 0). We follow this practice without questioning it, but it is a * bug if frr calls ROUNDUP with 0. */ -#ifdef __APPLE__ -#define ROUNDUP_TYPE int -#else -#define ROUNDUP_TYPE long -#endif +#define ROUNDUP_TYPE long /* * Because of these varying conventions, the only sane approach is for -- 2.39.5