File: stdint_compat.h

package info (click to toggle)
brian 2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,872 kB
  • sloc: python: 51,820; cpp: 2,033; makefile: 108; sh: 72
file content (20 lines) | stat: -rw-r--r-- 490 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef _BRIAN_STDINT_COMPAT_H
#define _BRIAN_STDINT_COMPAT_H
// Work around the fact that older MSVC versions don't have stdint.h
#ifdef _MSC_VER
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
// Implement the int_ function here so that it can also be used from Cython
template<typename T> inline int int_(T value)
{
    return (int)value;
}
template<> inline int int_(bool value)
{
    return value ? 1 : 0;
}
#endif