Skip to content

Commit e46875e

Browse files
committed
defines in pyconfig in terms of llvm variables
1 parent 5c838b2 commit e46875e

File tree

1 file changed

+24
-23
lines changed
  • graalpython/com.oracle.graal.python.cext/include

1 file changed

+24
-23
lines changed

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

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,31 @@
1111
#define Py_PYCONFIG_H
1212

1313

14-
// TRUFFLE DEFS
15-
#define SIZEOF_DOUBLE 8
16-
#define SIZEOF_FLOAT 4
17-
#define SIZEOF_FPOS_T 16
18-
#define SIZEOF_INT 4
19-
#define SIZEOF_LONG 8
20-
#define SIZEOF_LONG_DOUBLE 16
21-
#define SIZEOF_LONG_LONG 8
22-
#define SIZEOF_OFF_T 8
23-
#define SIZEOF_PID_T 4
24-
#define SIZEOF_PTHREAD_T 8
25-
#define SIZEOF_SHORT 2
26-
#define SIZEOF_SIZE_T 8
27-
#define SIZEOF_TIME_T 8
28-
#define SIZEOF_UINTPTR_T 8
29-
#define SIZEOF_VOID_P 8
30-
#define SIZEOF_WCHAR_T 2
14+
// defines based on Clang defines
15+
#define SIZEOF_DOUBLE __SIZEOF_DOUBLE__
16+
#define SIZEOF_FLOAT __SIZEOF_FLOAT__
17+
#define SIZEOF_FPOS_T __SIZEOF_INT128__
18+
#define SIZEOF_INT __SIZEOF_INT__
19+
#define SIZEOF_LONG __SIZEOF_LONG__
20+
#define SIZEOF_LONG_DOUBLE __SIZEOF_LONG_DOUBLE__
21+
#define SIZEOF_LONG_LONG __SIZEOF_LONG_LONG__
22+
#define SIZEOF_OFF_T __SIZEOF_SIZE_T__
23+
#define SIZEOF_PID_T __SIZEOF_INT__
24+
#define SIZEOF_PTHREAD_T __SIZEOF_LONG__
25+
#define SIZEOF_SHORT __SIZEOF_SHORT__
26+
#define SIZEOF_SIZE_T __SIZEOF_SIZE_T__
27+
#define SIZEOF_TIME_T __SIZEOF_POINTER__
28+
#define SIZEOF_UINTPTR_T __SIZEOF_POINTER__
29+
#define SIZEOF_VOID_P __SIZEOF_POINTER__
30+
#define SIZEOF_WCHAR_T __SIZEOF_WCHAR_T__
3131
#define SIZEOF__BOOL 1
32-
#define INT_MIN 0x80000000
33-
#define INT_MAX 0x7fffffff
34-
#define UINT_MAX 0xffffffff
35-
#define SHRT_MIN 0x8000
36-
#define SHRT_MAX 0x7fff
37-
#define USHRT_MAX 0xffff
32+
#define INT_MIN ((-__INT32_MAX__)-1)
33+
#define INT_MAX __INT32_MAX__
34+
#define UINT_MAX __UINT32_MAX__
35+
#define SHRT_MIN ((-__INT16_MAX__)-1)
36+
#define SHRT_MAX __INT16_MAX__
37+
#define USHRT_MAX __UINT16_MAX__
38+
#define CHAR_BIT __CHAR_BIT__
3839
// #define Py_LIMITED_API 1
3940
#define _Py_BEGIN_SUPPRESS_IPH
4041
#define _Py_END_SUPPRESS_IPH

0 commit comments

Comments
 (0)