| 1 |
#ifndef _BRIAN_STDINT_COMPAT_H |
| 2 |
#define _BRIAN_STDINT_COMPAT_H |
| 3 |
// Work around the fact that older MSVC versions don't have stdint.h |
| 4 |
#ifdef _MSC_VER |
| 5 |
typedef __int32 int32_t; |
| 6 |
typedef __int64 int64_t; |
| 7 |
typedef unsigned __int64 uint64_t; |
| 8 |
#else |
| 9 |
#include <stdint.h> |
| 10 |
#endif |
| 11 |
// Implement the int_ function here so that it can also be used from Cython |
| 12 |
template<typename T> inline int int_(T value) |
| 13 |
{ |
| 14 |
return (int)value; |
| 15 |
} |
| 16 |
template<> inline int int_(bool value) |
| 17 |
{ |
| 18 |
return value ? 1 : 0; |
| 19 |
} |
| 20 |
#endif |