Fix conflicts.

This commit is contained in:
Sacha 2014-07-12 17:02:39 +10:00
parent c09b0f511e
commit 9816ec3aa0
35 changed files with 99 additions and 103 deletions

View file

@ -1,20 +1,23 @@
#include <time.h>
#include <sys/time.h>
#include "GNU.h"
#ifdef __APPLE__
void * _aligned_malloc(size_t size, size_t alignment) {
void *buffer;
posix_memalign(&buffer, alignment, size);
return buffer;
}
#include <time.h>
#include <sys/time.h>
int clock_gettime(int foo, struct timespec *ts) {
struct timeval tv;
struct timeval tv;
gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
return(0);
gettimeofday(&tv, NULL);
ts->tv_sec = tv.tv_sec;
ts->tv_nsec = tv.tv_usec * 1000;
return(0);
}
#endif /* !__APPLE__ */
#endif /* __APPLE__ */
#if defined(__GNUG__)
void * _aligned_malloc(size_t size, size_t alignment) {
void *buffer;
return (posix_memalign(&buffer, alignment, size) == 0) ? buffer : 0;
}
#endif

View file

@ -28,7 +28,6 @@ void strcpy_trunc(char (&dst)[size], const std::string& src)
#define _byteswap_ushort(x) __builtin_bswap16(x)
#define _byteswap_ulong(x) __builtin_bswap32(x)
#define _byteswap_uint64(x) __builtin_bswap64(x)
#define Sleep(x) usleep(x * 1000)
#define mkdir(x) mkdir(x, 0777)
#define INFINITE 0xFFFFFFFF
#define _CRT_ALIGN(x) __attribute__((aligned(x)))
@ -61,10 +60,10 @@ inline int64_t __mulh(int64_t a, int64_t b)
return result;
}
#ifndef __APPLE__
#define _aligned_malloc(size,alignment) memalign(alignment,size)
#else
void * _aligned_malloc(size_t size, size_t alignment);
#ifdef __APPLE__
int clock_gettime(int foo, struct timespec *ts);
#define wxIsNaN(x) ((x) != (x))
@ -72,7 +71,7 @@ int clock_gettime(int foo, struct timespec *ts);
#define CLOCK_MONOTONIC 0
#endif /* !CLOCK_MONOTONIC */
#endif /* !__APPLE__ */
#endif /* __APPLE__ */
#define _aligned_free free

View file

@ -14,7 +14,7 @@ __forceinline void SM_Sleep()
}
else
{
Sleep(1);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}

View file

@ -177,7 +177,7 @@ private:
Step();
}
while(!TestDestroy()) Sleep(0);
while(!TestDestroy()) std::this_thread::sleep_for(std::chrono::milliseconds(0));
if(m_destroy_sem.TryWait() != wxSEMA_NO_ERROR) m_destroy_sem.Post();
}
@ -198,7 +198,7 @@ public:
{
if(!IsRunning()) return;
while(m_main_sem.TryWait() != wxSEMA_NO_ERROR) Sleep(0);
while(m_main_sem.TryWait() != wxSEMA_NO_ERROR) std::this_thread::sleep_for(std::chrono::milliseconds(0));
}
void Exit(bool wait = false)