Skip to content

Commit 88a4ef3

Browse files
committed
Add pycall_python_major_version function
1 parent 8d09107 commit 88a4ef3

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

ext/pycall/pycall.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,21 @@ static VALUE python_type_mapping;
3030
static VALUE python_type_mapping;
3131
static ID id_python_type_mapping;
3232

33+
int
34+
pycall_python_major_version(void)
35+
{
36+
return python_major_version;
37+
}
38+
3339
Py_ssize_t
3440
pycall_python_hexversion(void)
3541
{
3642
return python_hexversion;
3743
}
3844

45+
#undef pycall_python_major_version
46+
#define pycall_python_major_version() python_major_version
47+
3948
#undef pycall_python_hexversion
4049
#define pycall_python_hexversion() python_hexversion
4150

ext/pycall/pycall_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ typedef struct {
620620
pycall_libpython_api_table_t *pycall_libpython_api_table(void);
621621
#define Py_API(name) (pycall_libpython_api_table()->name)
622622

623+
int pycall_python_major_version(void);
623624
Py_ssize_t pycall_python_hexversion(void);
624625
#define pycall_python_long_hash (pycall_python_hexversion() < 0x03020000)
625626

0 commit comments

Comments
 (0)