On windows i'm using MinGW. When i was compiling demos i had an error /bullet-2.75/src/MiniCL/cl_platform.h:47: error: `__int8' does not name a type.
The problem was in block #ifdef _WIN32. MinGW has already types int*_t; but hasn't types __int*, it's only for VisualStudio.
And this block doesn't work
Code: Select all
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
****************************Then we have code for Unix platforms(gcc compiler)
Code: Select all
[color=#BF0000]#else
#include <stdint.h>[/color]
/* scalar types */
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
typedef int16_t cl_short __attribute__((aligned(2)));
typedef uint16_t cl_ushort __attribute__((aligned(2)));
typedef int32_t cl_int __attribute__((aligned(4)));
typedef uint32_t cl_uint __attribute__((aligned(4)));
typedef int64_t cl_long __attribute__((aligned(8)));
typedef uint64_t cl_ulong __attribute__((aligned(8)));Original file
#ifndef __CL_PLATFORM_H
#define __CL_PLATFORM_H
*************************************
#ifdef _WIN32
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
*************************
#else
#include <stdint.h>
/* scalar types */
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
typedef int16_t cl_short __attribute__((aligned(2)));
typedef uint16_t cl_ushort __attribute__((aligned(2)));
typedef int32_t cl_int __attribute__((aligned(4)));
typedef uint32_t cl_uint __attribute__((aligned(4)));
typedef int64_t cl_long __attribute__((aligned(8)));
typedef uint64_t cl_ulong __attribute__((aligned(8)));
*********************************
#endif
#include <stddef.h>
*********************************
#ifdef __cplusplus
}
#endif
#endif // __CL_PLATFORM_H
When i've swaped this blocks all was OK for MinGW.
*************************************
//#ifdef WIN32
#ifdef __MINGW32__
#include <stdint.h>
/* scalar types */
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
typedef int16_t cl_short __attribute__((aligned(2)));
typedef uint16_t cl_ushort __attribute__((aligned(2)));
typedef int32_t cl_int __attribute__((aligned(4)));
typedef uint32_t cl_uint __attribute__((aligned(4)));
typedef int64_t cl_long __attribute__((aligned(8)));
typedef uint64_t cl_ulong __attribute__((aligned(8)));
*********************************
#else
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef int8_t cl_char;
typedef uint8_t cl_uchar;
*************************
#endif
#include <stddef.h>
*********************************
#ifdef __cplusplus
}
#endif
#endif // __CL_PLATFORM_H