Use ugly hack for compile bullet with 64-bit mingw until I will find better solution

This commit is contained in:
Deve 2015-10-13 00:55:11 +02:00
parent 375e7ea0ed
commit 407f29641c
2 changed files with 21 additions and 0 deletions

View File

@ -58,15 +58,24 @@ static inline void btAlignedFreeDefault(void *ptr)
free(ptr);
}
#else
static inline void *btAlignedAllocDefault(size_t size, int alignment)
{
void *ret;
char *real;
#ifdef __MINGW64__
uintptr_t offset;
#else
unsigned long offset;
#endif
real = (char *)sAllocFunc(size + sizeof(void *) + (alignment-1));
if (real) {
#ifdef __MINGW64__
offset = (alignment - (uintptr_t)(real + sizeof(void *))) & (alignment-1);
#else
offset = (alignment - (unsigned long)(real + sizeof(void *))) & (alignment-1);
#endif
ret = (void *)((real + sizeof(void *)) + offset);
*((void **)(ret)-1) = (void *)(real);
} else {

View File

@ -213,7 +213,11 @@ protected:
int *intPtr=0;
short *shtPtr=0;
#ifdef __MINGW64__
char *cp = 0;int dataLen =0;intptr_t nr=0;
#else
char *cp = 0;int dataLen =0;long nr=0;
#endif
intPtr = (int*)m_dna;
/*
@ -247,7 +251,11 @@ protected:
cp++;
}
{
#ifdef __MINGW64__
nr= (intptr_t)cp;
#else
nr= (long)cp;
#endif
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)
@ -282,7 +290,11 @@ protected:
}
{
#ifdef __MINGW64__
nr= (intptr_t)cp;
#else
nr= (long)cp;
#endif
// long mask=3;
nr= ((nr+3)&~3)-nr;
while (nr--)