Include limits.h if we have it.
diff --git a/Python/codecs.c b/Python/codecs.c
index 20df522..27331ab 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -10,6 +10,9 @@
 
 #include "Python.h"
 #include <ctype.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
 
 /* --- Globals ------------------------------------------------------------ */