Don't include headers in a namespace definition
This commit is contained in:
+8
-4
@@ -114,10 +114,10 @@ void althrd_setname(const char *name)
|
||||
void althrd_setname(const char*) { }
|
||||
#endif
|
||||
|
||||
namespace al {
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
namespace al {
|
||||
|
||||
semaphore::semaphore(unsigned int initial)
|
||||
{
|
||||
mSem = dispatch_semaphore_create(initial);
|
||||
@@ -137,10 +137,14 @@ void semaphore::wait() noexcept
|
||||
bool semaphore::try_wait() noexcept
|
||||
{ return dispatch_semaphore_wait(mSem, DISPATCH_TIME_NOW) == 0; }
|
||||
|
||||
} // namespace al
|
||||
|
||||
#else /* !__APPLE__ */
|
||||
|
||||
#include <cerrno>
|
||||
|
||||
namespace al {
|
||||
|
||||
semaphore::semaphore(unsigned int initial)
|
||||
{
|
||||
if(sem_init(&mSem, 0, initial) != 0)
|
||||
@@ -165,8 +169,8 @@ void semaphore::wait() noexcept
|
||||
bool semaphore::try_wait() noexcept
|
||||
{ return sem_trywait(&mSem) == 0; }
|
||||
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
} // namespace al
|
||||
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
Reference in New Issue
Block a user