Fix building on OSX, broken since "Clean up threading"
authorPavel Puchkin <i@neoascetic.me>
Thu, 27 Aug 2015 18:51:07 +0000 (20:51 +0200)
committerest31 <MTest31@outlook.com>
Sun, 6 Sep 2015 03:34:02 +0000 (05:34 +0200)
Commit

e4bff8be94c0db4f94e63ad448d0eeb869ccdbbd - Clean up threading

by @ShadowNinja has broken the OSX build.

Including things inside a namespace isn't good.

Also fixes #3124.

src/porting.h
src/threading/thread.cpp

index 492c9d3a8d5e6326a6173e203a7835f4600da972..a4016e8d7b43e5ee4e4e6587cbb9c2b1bc83cdf2 100644 (file)
@@ -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
 {
 
@@ -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()
        {
@@ -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()
        {
index a1cb720afac976bdbf8c827964cacd3f5e71b196..73a951194f471ff1bf54d7b53d40f836a58ab497 100644 (file)
@@ -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