Skip to content

Commit

Permalink
Fix building on OSX, broken since "Clean up threading"
Browse files Browse the repository at this point in the history
Commit

e4bff8b - Clean up threading

by @ShadowNinja has broken the OSX build.

Including things inside a namespace isn't good.

Also fixes #3124.
  • Loading branch information
neoascetic authored and est31 committed Sep 6, 2015
1 parent 91bf68e commit 588f0c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/porting.h
Expand Up @@ -108,6 +108,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <CoreFoundation/CoreFoundation.h>
#endif

#ifndef _WIN32 // Posix
#include <sys/time.h>
#include <time.h>
#if defined(__MACH__) && defined(__APPLE__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif
#endif

namespace porting
{

Expand Down Expand Up @@ -158,10 +167,6 @@ void initIrrlicht(irr::IrrlichtDevice * );
Overflow can occur at any value higher than 10000000.
*/
#ifdef _WIN32 // Windows
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#endif
#include <windows.h>

inline u32 getTimeS()
{
Expand Down Expand Up @@ -190,12 +195,6 @@ void initIrrlicht(irr::IrrlichtDevice * );
}

#else // Posix
#include <sys/time.h>
#include <time.h>
#if defined(__MACH__) && defined(__APPLE__)
#include <mach/clock.h>
#include <mach/mach.h>
#endif

inline u32 getTimeS()
{
Expand Down
2 changes: 1 addition & 1 deletion src/threading/thread.cpp
Expand Up @@ -80,7 +80,7 @@ DEALINGS IN THE SOFTWARE.
#include <sys/processor.h>
#elif defined(__APPLE__)
#include <mach/mach_init.h>
#include <mach/thread_policy.h>
#include <mach/thread_act.h>
#endif


Expand Down

0 comments on commit 588f0c1

Please sign in to comment.