Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19eddb5

Browse files
authored
gh-107211: No longer export internal _PyLong_FromUid() (#109037)
No longer export _PyLong_FromUid() and _Py_Sigset_Converter() internal C API function.
1 parent a52a350 commit 19eddb5

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Modules/posixmodule.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,37 @@
22

33
#ifndef Py_POSIXMODULE_H
44
#define Py_POSIXMODULE_H
5+
#ifndef Py_LIMITED_API
56
#ifdef __cplusplus
67
extern "C" {
78
#endif
89

910
#ifdef HAVE_SYS_TYPES_H
10-
#include <sys/types.h>
11+
# include <sys/types.h> // uid_t
1112
#endif
1213

13-
#ifndef Py_LIMITED_API
1414
#ifndef MS_WINDOWS
15-
PyAPI_FUNC(PyObject *) _PyLong_FromUid(uid_t);
16-
PyAPI_FUNC(PyObject *) _PyLong_FromGid(gid_t);
15+
extern PyObject* _PyLong_FromUid(uid_t);
16+
17+
// Export for 'grp' shared extension
18+
PyAPI_FUNC(PyObject*) _PyLong_FromGid(gid_t);
19+
20+
// Export for '_posixsubprocess' shared extension
1721
PyAPI_FUNC(int) _Py_Uid_Converter(PyObject *, uid_t *);
22+
23+
// Export for 'grp' shared extension
1824
PyAPI_FUNC(int) _Py_Gid_Converter(PyObject *, gid_t *);
19-
#endif /* MS_WINDOWS */
25+
#endif // !MS_WINDOWS
2026

21-
#if defined(PYPTHREAD_SIGMASK) || defined(HAVE_SIGWAIT) || \
22-
defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
23-
# define HAVE_SIGSET_T
27+
#if (defined(PYPTHREAD_SIGMASK) || defined(HAVE_SIGWAIT) \
28+
|| defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT))
29+
# define HAVE_SIGSET_T
2430
#endif
2531

26-
PyAPI_FUNC(int) _Py_Sigset_Converter(PyObject *, void *);
27-
#endif /* Py_LIMITED_API */
32+
extern int _Py_Sigset_Converter(PyObject *, void *);
2833

2934
#ifdef __cplusplus
3035
}
3136
#endif
32-
#endif /* !Py_POSIXMODULE_H */
37+
#endif // !Py_LIMITED_API
38+
#endif // !Py_POSIXMODULE_H

0 commit comments

Comments
 (0)