Skip to content

Commit

Permalink
*: Remove APPLE #defines from build
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
donaldsharp committed Nov 6, 2023
1 parent 3930af0 commit 3003c3e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 32 deletions.
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1180,9 +1180,6 @@ m4_define([FRR_INCLUDES],
/* Required for MAXSIG */
#include <signal.h>
#include <sys/socket.h>
#ifdef __APPLE__
# define __APPLE_USE_RFC_3542
#endif
#include <netinet/in.h>
#include <sys/time.h>
#include <time.h>
Expand Down
5 changes: 0 additions & 5 deletions lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mach/mach.h>
#include <mach/mach_time.h>
#endif

#define AWAKEN(m) \
do { \
const unsigned char wakebyte = 0x01; \
Expand Down
2 changes: 1 addition & 1 deletion lib/ntop.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const char *frr_inet_ntop(int af, const void * restrict src,
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)
*/
Expand Down
13 changes: 6 additions & 7 deletions lib/sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 3 additions & 8 deletions lib/zebra.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@
#include <sys/sockio.h>
#endif /* HAVE_SYS_SOCKIO_H */

#ifdef __APPLE__
#define __APPLE_USE_RFC_3542
#endif

#ifndef HAVE_LIBCRYPT
#ifdef HAVE_LIBCRYPTO
#include <openssl/des.h>
Expand Down Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions lib/zlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#ifdef __DragonFly__
#include <sys/lwp.h>
#endif
#ifdef __APPLE__
#include <mach/mach_traps.h>
#endif

#ifdef HAVE_LIBUNWIND
#define UNW_LOCAL_ONLY
Expand Down
6 changes: 1 addition & 5 deletions zebra/kernel_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3003c3e

Please sign in to comment.