Include <cstdint> in one place, remove custom typedefs

Originating from
[this SO issue](https://stackoverflow.com/questions/65901014/how-to-solve-this-all-error-2-in-this-case),
some win32 compilers define `__int32` as a `long`, but MinGW defines
`std::int32_t` as an `int`, leading to a type conflict.

To avoid this, we remove the custom `typedef` definitions for win32.  The
Tensor module requires C++11 anyways, so we are guaranteed to have
included `<cstdint>` already in `Eigen/Core`.

Also re-arranged the headers to only include `<cstdint>` in one place to
avoid this type of error again.
This commit is contained in:
Antonio Sanchez
2021-01-26 13:39:34 -08:00
parent 0784d9f87b
commit 3f4684f87d
4 changed files with 39 additions and 54 deletions

View File

@@ -41,18 +41,6 @@
#include <random>
#include <thread>
#ifdef _WIN32
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#include <windows.h>
#else
#include <stdint.h>
#endif
#ifdef _WIN32
#include <windows.h>
#elif defined(__APPLE__)

View File

@@ -33,7 +33,6 @@
#if __cplusplus > 199711L || EIGEN_COMP_MSVC >= 1900
#include <cstddef>
#include <cstring>
#include <stdint.h>
#include <time.h>
#include <vector>