From 2a47c6537b79de4f1d9d24aa42f8b5837b3471c4 Mon Sep 17 00:00:00 2001
From: Jorge Canizales <jcanizales@google.com>
Date: Sun, 29 Nov 2015 22:25:28 -0800
Subject: [PATCH] BoringSSL.podspec: Workaround Swift compiler problem.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Maybe it’s Cocoapods.
---
 BoringSSL.podspec | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/BoringSSL.podspec b/BoringSSL.podspec
index 15dc9f17c2..08f009fadc 100644
--- a/BoringSSL.podspec
+++ b/BoringSSL.podspec
@@ -79,10 +79,15 @@ Pod::Spec.new do |s|
   s.compiler_flags = '-DOPENSSL_NO_ASM', '-GCC_WARN_INHIBIT_ALL_WARNINGS', '-w'
   s.requires_arc = false
 
-  # This is a bit ridiculous, but requiring people to install Go in order to build is slightly more
-  # ridiculous IMO. This is the last part of the podspec.
-  # TODO(jcanizales): Translate err_data_generate.go into a Bash or Ruby script.
   s.prepare_command = <<-END_OF_COMMAND
+    # Replace "const BIGNUM *I" in rsa.h with a lowercase i, as the former fails when including
+    # OpenSSL in a Swift bridging header (complex.h defines "I", and it's as if the compiler
+    # included it in every bridged header).
+    sed -E -i '.back' 's/\\*I,/*i,/g' include/openssl/rsa.h
+
+    # This is a bit ridiculous, but requiring people to install Go in order to build is slightly
+    # more ridiculous IMO. This is the last part of the podspec.
+    # TODO(jcanizales): Translate err_data_generate.go into a Bash or Ruby script.
     cat > err_data.c <<EOF
       /* Copyright (c) 2015, Google Inc.
        *
-- 
GitLab