Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS compilation fix #1

Closed
gkorovkin opened this issue Feb 21, 2018 · 1 comment
Closed

macOS compilation fix #1

gkorovkin opened this issue Feb 21, 2018 · 1 comment

Comments

@gkorovkin
Copy link

gkorovkin commented Feb 21, 2018

Hi William! Got two issue around with macOS builds - just want share with you

  1. Removing old macros definition for higher OpenSSL version (MacOS mostly-didn't check it under linux compilation yet) - we got that macros defined in openssl library at least for macports version
diff --git a/src/ptclib/pssl.cxx b/src/ptclib/pssl.cxx
index 6ef2ecb..1a6cda7 100644
--- a/src/ptclib/pssl.cxx
+++ b/src/ptclib/pssl.cxx
@@ -670,7 +670,7 @@ PSSLDiffieHellman::~PSSLDiffieHellman()
     DH_free(dh);
 }
 
-#ifdef P_d2i_DHparams_bio_OLD
+#if defined(P_d2i_DHparams_bio_OLD) && OPENSSL_VERSION_NUMBER < 0x100020efL
 // 2/21/04 Yuri Kiryanov - fix for compiler choke on BeOS for usage of
 // SSL function d2i_DHparams_bio below in PSSLDiffieHellman::Load
 // 5/26/06 Hannes Friederich - Mac OS X seems to need that fix too...
  1. And the second one(oldest) pthread_yield is not here
diff --git a/src/ptlib/unix/tlibthrd.cxx b/src/ptlib/unix/tlibthrd.cxx
index 4a30dd0..8402cd7 100644
--- a/src/ptlib/unix/tlibthrd.cxx
+++ b/src/ptlib/unix/tlibthrd.cxx
@@ -1534,7 +1534,11 @@ PTimedMutex::~PTimedMutex()
     for (PINDEX i = 0; i < 100; ++i) {
       if ((result = pthread_mutex_destroy(&m_mutex)) != EBUSY)
         break;
+#ifdef __MACH__
+      sched_yield();
+#else
       pthread_yield();
+#endif
     }
   }

Also it's an issue with installing version.h file under macOS - but emacs ruined all tabs/spaces in Makefile.in so the diff it's just uninformative - will send a bit later

@willamowius
Copy link
Owner

Both patches applied. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants