This patch fixes compilation on Mac OS X since the CSemaphore on Mac OS X uses the Sleep() function in the sync.h file.
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-
ahf commented at 10:12 AM on May 17, 2012: none
-
Fix compilation on Mac OS X. b409a413bc
-
laanwj commented at 10:46 AM on May 17, 2012: member
Nice try, but this creates a circular dependency (
util.h↔sync.h). Please solve it in another way. -
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.
-
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.
-
ahf commented at 11:20 AM on May 17, 2012: none
Where exactly is the circular dependency between those headers?
sync.hincludesutil.honly on OS X if this patch is applied, bututil.honly includesnetbase.hwhich does not includesync.h.How would you prefer this to be solved? A forward declaration or moving the
Sleep()function around? -
ahf commented at 11:48 AM on May 17, 2012: none
Looks much better. Let's continue with that instead.
- ahf closed this on May 17, 2012
- suprnurd referenced this in commit 0b54ab85c8 on Dec 5, 2017
- lateminer referenced this in commit 3b72231a32 on Jan 22, 2019
- lateminer referenced this in commit b766048068 on May 6, 2020
- lateminer referenced this in commit 6143e95f98 on May 6, 2020
- lateminer referenced this in commit c992fc1523 on May 6, 2020
- bitcoin locked this on Sep 8, 2021