summaryrefslogtreecommitdiffstats
path: root/Python/mystrtoul.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/mystrtoul.c')
-rw-r--r--Python/mystrtoul.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index e6fe154..fcd3e27 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -1,16 +1,22 @@
+// strtol() and strtoul(), renamed to avoid conflicts.
+//
+// API:
+//
+// - PyOS_strtol(): convert string to C long integer.
+// - PyOS_strtoul(): convert string to C unsigned long integer.
+
#include "Python.h"
#include "pycore_long.h" // _PyLong_DigitValue
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
-#define _SGI_MP_SOURCE
+# define _SGI_MP_SOURCE
#endif
/* strtol and strtoul, renamed to avoid conflicts */
-#include <ctype.h>
#ifdef HAVE_ERRNO_H
-#include <errno.h>
+# include <errno.h> // errno
#endif
/* Static overflow check values for bases 2 through 36.
@@ -75,7 +81,7 @@ static const int digitlimit[] = {
14, 14, 14, 14, 13, 13, 13, 13, 13, 13, /* 20 - 29 */
13, 12, 12, 12, 12, 12, 12}; /* 30 - 36 */
#else
-#error "Need table for SIZEOF_LONG"
+# error "Need table for SIZEOF_LONG"
#endif
/*