Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.xiph.org/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKári Tristan Helgason <kthelgason@google.com>2017-11-09 15:34:55 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2017-11-17 00:16:33 +0300
commit46560534fcb5710a894a341c2f9526db58fd7087 (patch)
treecacf35a094fcd5fd22971b31cd134c6e516a3973 /include
parentab7ab106b266eac5ee69f4aa35307c66238faa06 (diff)
Define integer types from stdint.h where it's available
This fixes issues when using neon intrinsics on 64-bit systems. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
Diffstat (limited to 'include')
-rw-r--r--include/opus_types.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/include/opus_types.h b/include/opus_types.h
index 71808266..7cf67558 100644
--- a/include/opus_types.h
+++ b/include/opus_types.h
@@ -33,14 +33,29 @@
#ifndef OPUS_TYPES_H
#define OPUS_TYPES_H
+#define opus_int int /* used for counters etc; at least 16 bits */
+#define opus_int64 long long
+#define opus_int8 signed char
+
+#define opus_uint unsigned int /* used for counters etc; at least 16 bits */
+#define opus_uint64 unsigned long long
+#define opus_uint8 unsigned char
+
/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
#include <stdint.h>
-
+# undef opus_int64
+# undef opus_int8
+# undef opus_uint64
+# undef opus_uint8
+ typedef int8_t opus_int8;
+ typedef uint8_t opus_uint8;
typedef int16_t opus_int16;
typedef uint16_t opus_uint16;
typedef int32_t opus_int32;
typedef uint32_t opus_uint32;
+ typedef int64_t opus_int64;
+ typedef uint64_t opus_uint64;
#elif defined(_WIN32)
# if defined(__CYGWIN__)
@@ -148,12 +163,4 @@
#endif
-#define opus_int int /* used for counters etc; at least 16 bits */
-#define opus_int64 long long
-#define opus_int8 signed char
-
-#define opus_uint unsigned int /* used for counters etc; at least 16 bits */
-#define opus_uint64 unsigned long long
-#define opus_uint8 unsigned char
-
#endif /* OPUS_TYPES_H */