]> 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 24f822a0d7584ad385948da458fadb03f3d2b603..29ac778efa017263dfa0de8d6bfc8f8653b93dd9 100644 (file)
@@ -7,7 +7,7 @@
 /*                                                                           */
 /*                                                                           */
 /* (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