]> git.sur5r.net Git - cc65/blobdiff - src/common/inttypes.h
Fixed LinuxDoc Tools issues in some verbatim blocks in the Atari document.
[cc65] / src / common / inttypes.h
index 0d9cb75fc0d991aef6139287a474e62edfae70bd..29ac778efa017263dfa0de8d6bfc8f8653b93dd9 100644 (file)
 
 
 
-/* If we have stdint.h, include it, otherwise try some quesswork on types.
+/* 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 a check for
-** defined(__GNUC__) or defined(_MSC_VER) is not necessary.
+** 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.
+/* Assume that ptrdiff_t and size_t are wide enough to hold pointers.
+** Assume that they are the widest type.
 */
-typedef long intptr_t;
-typedef unsigned long uintptr_t;
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
-
+#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