replace PY_SIZE_MAX with SIZE_MAX
diff --git a/Include/pyport.h b/Include/pyport.h
index 2f78052..94c135f 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -115,16 +115,8 @@
 typedef int Py_ssize_clean_t;
 #endif
 
-/* Largest possible value of size_t.
-   SIZE_MAX is part of C99, so it might be defined on some
-   platforms. If it is not defined, (size_t)-1 is a portable
-   definition for C89, due to the way signed->unsigned
-   conversion is defined. */
-#ifdef SIZE_MAX
+/* Largest possible value of size_t. */
 #define PY_SIZE_MAX SIZE_MAX
-#else
-#define PY_SIZE_MAX ((size_t)-1)
-#endif
 
 /* Largest positive value of type Py_ssize_t. */
 #define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index ca5ab2c..dd8417a 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1787,7 +1787,7 @@
                 step = -step;
             }
 
-            assert((size_t)slicelen <= PY_SIZE_MAX / sizeof(PyObject *));
+            assert((size_t)slicelen <= SIZE_MAX / sizeof(PyObject *));
 
             /* recycle is a list that will contain all the children
              * scheduled for removal.
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 8afc4d5..21f063d 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -976,7 +976,7 @@
 };
 
 
-#if PY_SIZE_MAX > INT_MAX
+#if SIZE_MAX > INT_MAX
 #define CHECK_STRING_LENGTH(s) do {                                     \
         if (s != NULL && strlen(s) >= INT_MAX) {                        \
             PyErr_SetString(PyExc_OverflowError, "string is too long"); \
diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c
index 1a53cfe..ec8bd96 100644
--- a/Modules/_tracemalloc.c
+++ b/Modules/_tracemalloc.c
@@ -655,7 +655,7 @@
         }
     }
 
-    assert(tracemalloc_traced_memory <= PY_SIZE_MAX - size);
+    assert(tracemalloc_traced_memory <= SIZE_MAX - size);
     tracemalloc_traced_memory += size;
     if (tracemalloc_traced_memory > tracemalloc_peak_traced_memory)
         tracemalloc_peak_traced_memory = tracemalloc_traced_memory;
@@ -672,7 +672,7 @@
     PyMemAllocatorEx *alloc = (PyMemAllocatorEx *)ctx;
     void *ptr;
 
-    assert(elsize == 0 || nelem <= PY_SIZE_MAX / elsize);
+    assert(elsize == 0 || nelem <= SIZE_MAX / elsize);
 
     if (use_calloc)
         ptr = alloc->calloc(alloc->ctx, nelem, elsize);
diff --git a/Modules/audioop.c b/Modules/audioop.c
index d715783..44e5198 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -1337,7 +1337,7 @@
     weightA /= d;
     weightB /= d;
 
-    if ((size_t)nchannels > PY_SIZE_MAX/sizeof(int)) {
+    if ((size_t)nchannels > SIZE_MAX/sizeof(int)) {
         PyErr_SetString(PyExc_MemoryError,
                         "not enough memory for output buffer");
         return NULL;
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 90bbf2a..dcd7b5e 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -49,7 +49,7 @@
     new_allocated = (newsize >> 3) + (newsize < 9 ? 3 : 6);
 
     /* check for integer overflow */
-    if (new_allocated > PY_SIZE_MAX - newsize) {
+    if (new_allocated > SIZE_MAX - newsize) {
         PyErr_NoMemory();
         return -1;
     } else {
@@ -59,7 +59,7 @@
     if (newsize == 0)
         new_allocated = 0;
     items = self->ob_item;
-    if (new_allocated <= (PY_SIZE_MAX / sizeof(PyObject *)))
+    if (new_allocated <= (SIZE_MAX / sizeof(PyObject *)))
         PyMem_RESIZE(items, PyObject *, new_allocated);
     else
         items = NULL;
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 6eb40e4..740b7f5 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -721,7 +721,7 @@
     assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0);
     if (ndigits > 0) {
         digit msd = v->ob_digit[ndigits - 1];
-        if ((size_t)(ndigits - 1) > PY_SIZE_MAX / (size_t)PyLong_SHIFT)
+        if ((size_t)(ndigits - 1) > SIZE_MAX / (size_t)PyLong_SHIFT)
             goto Overflow;
         result = (size_t)(ndigits - 1) * (size_t)PyLong_SHIFT;
         do {
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index c201da1..54d68b7 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -1057,7 +1057,7 @@
         if (numarenas <= maxarenas)
             return NULL;                /* overflow */
 #if SIZEOF_SIZE_T <= SIZEOF_INT
-        if (numarenas > PY_SIZE_MAX / sizeof(*arenas))
+        if (numarenas > SIZE_MAX / sizeof(*arenas))
             return NULL;                /* overflow */
 #endif
         nbytes = numarenas * sizeof(*arenas);
diff --git a/Parser/node.c b/Parser/node.c
index 0010324..240d290 100644
--- a/Parser/node.c
+++ b/Parser/node.c
@@ -91,7 +91,7 @@
     if (current_capacity < 0 || required_capacity < 0)
         return E_OVERFLOW;
     if (current_capacity < required_capacity) {
-        if ((size_t)required_capacity > PY_SIZE_MAX / sizeof(node)) {
+        if ((size_t)required_capacity > SIZE_MAX / sizeof(node)) {
             return E_NOMEM;
         }
         n = n1->n_child;
diff --git a/Python/asdl.c b/Python/asdl.c
index df387b2..c211078 100644
--- a/Python/asdl.c
+++ b/Python/asdl.c
@@ -9,14 +9,14 @@
 
     /* check size is sane */
     if (size < 0 ||
-        (size && (((size_t)size - 1) > (PY_SIZE_MAX / sizeof(void *))))) {
+        (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) {
         PyErr_NoMemory();
         return NULL;
     }
     n = (size ? (sizeof(void *) * (size - 1)) : 0);
 
     /* check if size can be added safely */
-    if (n > PY_SIZE_MAX - sizeof(asdl_seq)) {
+    if (n > SIZE_MAX - sizeof(asdl_seq)) {
         PyErr_NoMemory();
         return NULL;
     }
@@ -40,14 +40,14 @@
 
     /* check size is sane */
     if (size < 0 ||
-        (size && (((size_t)size - 1) > (PY_SIZE_MAX / sizeof(void *))))) {
+        (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) {
             PyErr_NoMemory();
             return NULL;
     }
     n = (size ? (sizeof(void *) * (size - 1)) : 0);
 
     /* check if size can be added safely */
-    if (n > PY_SIZE_MAX - sizeof(asdl_seq)) {
+    if (n > SIZE_MAX - sizeof(asdl_seq)) {
         PyErr_NoMemory();
         return NULL;
     }
diff --git a/Python/ast.c b/Python/ast.c
index 0f9c193..c5f363b 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3985,7 +3985,7 @@
     const char *end;
 
     /* check for integer overflow */
-    if (len > PY_SIZE_MAX / 6)
+    if (len > SIZE_MAX / 6)
         return NULL;
     /* "ä" (2 bytes) may become "\U000000E4" (10 bytes), or 1:5
        "\ä" (3 bytes) may become "\u005c\U000000E4" (16 bytes), or ~1:6 */
diff --git a/Python/compile.c b/Python/compile.c
index 6fe5d5f..45e4262 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -804,7 +804,7 @@
         oldsize = b->b_ialloc * sizeof(struct instr);
         newsize = oldsize << 1;
 
-        if (oldsize > (PY_SIZE_MAX >> 1)) {
+        if (oldsize > (SIZE_MAX >> 1)) {
             PyErr_NoMemory();
             return -1;
         }
@@ -4520,7 +4520,7 @@
     a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE);
     if (!a->a_lnotab)
         return 0;
-    if ((size_t)nblocks > PY_SIZE_MAX / sizeof(basicblock *)) {
+    if ((size_t)nblocks > SIZE_MAX / sizeof(basicblock *)) {
         PyErr_NoMemory();
         return 0;
     }