<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package ExtUtils::CBuilder::Platform::darwin;

use warnings;
use strict;
use ExtUtils::CBuilder::Platform::Unix;
use Config;

our $VERSION = '0.280240'; # VERSION
our @ISA = qw(ExtUtils::CBuilder::Platform::Unix);

my ($osver) = split /\./, $Config{osvers};
my $apple_cor = $^X eq "/usr/bin/perl" &amp;&amp; $osver &gt;= 18;

sub compile {
  my $self = shift;
  my $cf = $self-&gt;{config};

  # -flat_namespace isn't a compile flag, it's a linker flag.  But
  # it's mistakenly in Config.pm as both.  Make the correction here.
  local $cf-&gt;{ccflags} = $cf-&gt;{ccflags};
  $cf-&gt;{ccflags} =~ s/-flat_namespace//;

  # XCode 12 makes this fatal, breaking tons of XS modules
  $cf-&gt;{ccflags} .= ($cf-&gt;{ccflags} ? ' ' : '').'-Wno-error=implicit-function-declaration';

  $self-&gt;SUPER::compile(@_);
}

sub arg_include_dirs {
    my $self = shift;

    if ($apple_cor) {
        my $perl_inc = $self-&gt;perl_inc;
        return map {
           $_ eq $perl_inc ? ("-iwithsysroot", $_ ) : "-I$_"
        } @_;
    }
    else {
        return $self-&gt;SUPER::arg_include_dirs(@_);
    }
}

1;
</pre></body></html>