Skip to content

Commit 1f7cc64

Browse files
committed
Remove platform-specific type limits.
1 parent 8f00746 commit 1f7cc64

File tree

1 file changed

+13
-3
lines changed
  • graalpython/com.oracle.graal.python.cext/include

1 file changed

+13
-3
lines changed

graalpython/com.oracle.graal.python.cext/include/pyconfig.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -41,6 +41,8 @@
4141
#ifndef Py_PYCONFIG_H
4242
#define Py_PYCONFIG_H
4343

44+
// required for __UINT32_MAX__ etc.
45+
#include <limits.h>
4446

4547
// defines based on Clang defines
4648
#define SIZEOF_DOUBLE __SIZEOF_DOUBLE__
@@ -60,13 +62,21 @@
6062
#define SIZEOF_VOID_P __SIZEOF_POINTER__
6163
#define SIZEOF_WCHAR_T __SIZEOF_WCHAR_T__
6264
#define SIZEOF__BOOL 1
63-
#define INT_MIN ((-__INT32_MAX__)-1)
64-
#define INT_MAX __INT32_MAX__
65+
# ifndef UINT_MAX
6566
#define UINT_MAX __UINT32_MAX__
67+
#endif
68+
# ifndef SHRT_MIN
6669
#define SHRT_MIN ((-__INT16_MAX__)-1)
70+
#endif
71+
# ifndef SHRT_MAX
6772
#define SHRT_MAX __INT16_MAX__
73+
#endif
74+
# ifndef USHRT_MAX
6875
#define USHRT_MAX __UINT16_MAX__
76+
#endif
77+
# ifndef CHAR_BIT
6978
#define CHAR_BIT __CHAR_BIT__
79+
#endif
7080
// #define Py_LIMITED_API 1
7181
#define _Py_BEGIN_SUPPRESS_IPH
7282
#define _Py_END_SUPPRESS_IPH

0 commit comments

Comments
 (0)