Fix compilation on Mac OS X. #1328

pull ahf wants to merge 1 commits into bitcoin:master from ahf:mac-os-x-buildfix changing 1 files +3 −2
  1. ahf commented at 10:12 AM on May 17, 2012: none

    This patch fixes compilation on Mac OS X since the CSemaphore on Mac OS X uses the Sleep() function in the sync.h file.

  2. Fix compilation on Mac OS X. b409a413bc
  3. laanwj commented at 10:46 AM on May 17, 2012: member

    Nice try, but this creates a circular dependency (util.hsync.h). Please solve it in another way.

  4. sipa commented at 10:49 AM on May 17, 2012: member

    Hmm, strange, some people tried this on OSX without problems...

    Anyway, I suppose Sleep() could move to sync, if it's a problem.

  5. laanwj commented at 10:59 AM on May 17, 2012: member

    Probably depends on the compiler version. Newer compilers will reject the use of undefined functions and types in parametrized templates. Older compilers will only check at instantiation time, so will let this pass.

  6. ahf commented at 11:20 AM on May 17, 2012: none

    Where exactly is the circular dependency between those headers? sync.h includes util.h only on OS X if this patch is applied, but util.h only includes netbase.h which does not include sync.h.

    How would you prefer this to be solved? A forward declaration or moving the Sleep() function around?

  7. laanwj commented at 11:31 AM on May 17, 2012: member

    You could also help testing #1292, which gets rid of the sleep workaround on MacOSX.

  8. ahf commented at 11:48 AM on May 17, 2012: none

    Looks much better. Let's continue with that instead.

  9. ahf closed this on May 17, 2012

  10. suprnurd referenced this in commit 0b54ab85c8 on Dec 5, 2017
  11. lateminer referenced this in commit 3b72231a32 on Jan 22, 2019
  12. lateminer referenced this in commit b766048068 on May 6, 2020
  13. lateminer referenced this in commit 6143e95f98 on May 6, 2020
  14. lateminer referenced this in commit c992fc1523 on May 6, 2020
  15. bitcoin locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:56 UTC