/* */
/* */
/* (C) 2004 Ullrich von Bassewitz */
-/* Römerstrasse 52 */
+/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
-/* If we have stdint.h, include it, otherwise try some quesswork on types.
- * gcc and msvc don't define __STDC_VERSION__ without special flags, so check
- * for them explicitly. Undefined symbols are replaced by zero, so a check for
- * defined(__GNUC__) or defined(_MSC_VER) is not necessary.
- */
+/* If we have <stdint.h>, include it; otherwise, adapt types from <stddef.h>.
+** gcc and msvc don't define __STDC_VERSION__ without special flags, so check
+** for them explicitly. Undefined symbols are replaced by zero; so, checks for
+** defined(__GNUC__) and defined(_MSC_VER) aren't necessary.
+*/
#if (__STDC_VERSION__ >= 199901) || (__GNUC__ >= 3) || (_MSC_VER >= 1600)
#include <stdint.h>
#else
-/* Assume long is the largest type available, and assume that pointers can be
- * safely converted into this type and back.
- */
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
-
+/* Assume that ptrdiff_t and size_t are wide enough to hold pointers.
+** Assume that they are the widest type.
+*/
+#include <stddef.h>
+typedef ptrdiff_t intptr_t;
+typedef size_t uintptr_t;
+typedef ptrdiff_t intmax_t;
+typedef size_t uintmax_t;
#endif
/* End of inttypes.h */
-
#endif