diff options
Diffstat (limited to 'gr-blocks/lib/float_array_to_int.cc')
-rw-r--r-- | gr-blocks/lib/float_array_to_int.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gr-blocks/lib/float_array_to_int.cc b/gr-blocks/lib/float_array_to_int.cc index 66b112c066..46f78db19e 100644 --- a/gr-blocks/lib/float_array_to_int.cc +++ b/gr-blocks/lib/float_array_to_int.cc @@ -27,10 +27,15 @@ #define _ISOC9X_SOURCE #include <float_array_to_int.h> #include <math.h> +#if __cplusplus >= 201103L +#include <cstdint> +using std::int64_t; +#else #include <stdint.h> +#endif -static const int64_t MAX_INT = 2147483647; // (2^31)-1 -static const int64_t MIN_INT = -2147483647; // -(2^31)-1 +static const int64_t MAX_INT = INT32_MAX; +static const int64_t MIN_INT = INT32_MIN; void float_array_to_int(const float *in, int *out, float scale, int nsamples) |