summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2010-10-26 10:56:31 +0000
committerMonty <xiphmont@xiph.org>2010-10-26 10:56:31 +0000
commit8bcc597b9c6c82e294bca535ff7b58503f49e4d8 (patch)
treea3c8af3eef9728931669ba50f2cdacba906523d0 /include
parent779d3f67a22f46463962a82aa97ccbfde7174fc7 (diff)
downloadogg-git-8bcc597b9c6c82e294bca535ff7b58503f49e4d8.tar.gz
Update/modernize the configure type checking, account for the fact that
int types might come from one of three different includes on a modern system. Try, if possible, to use types that don't rely on any of the includes such that the oldest systems have more of a fighting chance. Addresses Trac #849 svn path=/trunk/ogg/; revision=17566
Diffstat (limited to 'include')
-rw-r--r--include/ogg/config_types.h.in14
-rw-r--r--include/ogg/os_types.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/include/ogg/config_types.h.in b/include/ogg/config_types.h.in
index 568a001..750e29d 100644
--- a/include/ogg/config_types.h.in
+++ b/include/ogg/config_types.h.in
@@ -2,6 +2,20 @@
#define __CONFIG_TYPES_H__
/* these are filled in by configure */
+#define INCLUDE_INTTYPES_H @INCLUDE_INTTYPES_H@
+#define INCLUDE_STDINT_H @INCLUDE_STDINT_H@
+#define INCLUDE_SYS_TYPES_H @INCLUDE_SYS_TYPES_H@
+
+#if INCLUDE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#if INCLUDE_STDINT_H
+# include <stdint.h>
+#endif
+#if INCLUDE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
typedef @SIZE16@ ogg_int16_t;
typedef @USIZE16@ ogg_uint16_t;
typedef @SIZE32@ ogg_int32_t;
diff --git a/include/ogg/os_types.h b/include/ogg/os_types.h
index 4d4315d..7dc938c 100644
--- a/include/ogg/os_types.h
+++ b/include/ogg/os_types.h
@@ -68,7 +68,7 @@
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
-# include <sys/types.h>
+# include <inttypes.h>
typedef int16_t ogg_int16_t;
typedef u_int16_t ogg_uint16_t;
typedef int32_t ogg_int32_t;
@@ -140,7 +140,6 @@
#else
-# include <sys/types.h>
# include <ogg/config_types.h>
#endif