Added _REENTRANT definition
diff --git a/Python/mystrtoul.c b/Python/mystrtoul.c
index a646283..4181ea1 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -26,6 +26,10 @@
 #include "config.h"
 #endif
 
+#ifdef WITH_THREAD
+#define _REENTRANT
+#endif
+
 /* Convert a possibly signed character to a nonnegative int */
 /* XXX This assumes characters are 8 bits wide */
 #ifdef __CHAR_UNSIGNED__