Skip to content

Commit 571c622

Browse files
Move to pycore_unicodedata.h
1 parent 83bb3a9 commit 571c622

File tree

7 files changed

+23
-10
lines changed

7 files changed

+23
-10
lines changed

Include/cpython/unicodeobject.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -733,14 +733,6 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(
733733
Py_UCS4 ch /* Unicode character */
734734
);
735735

736-
PyAPI_FUNC(int) _PyUnicode_IsXidStart(
737-
Py_UCS4 ch /* Unicode character */
738-
);
739-
740-
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(
741-
Py_UCS4 ch /* Unicode character */
742-
);
743-
744736
// Helper array used by Py_UNICODE_ISSPACE().
745737
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
746738

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef Py_INTERNAL_UNICODEDATA_H
2+
#define Py_INTERNAL_UNICODEDATA_H
3+
#ifdef __cplusplus
4+
extern "C" {
5+
#endif
6+
7+
#ifndef Py_BUILD_CORE
8+
# error "this header requires Py_BUILD_CORE define"
9+
#endif
10+
11+
PyAPI_FUNC(int) _PyUnicode_IsXidStart(Py_UCS4 ch);
12+
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(Py_UCS4 ch);
13+
14+
#ifdef __cplusplus
15+
}
16+
#endif
17+
#endif /* !Py_INTERNAL_UNICODEDATA_H */

Include/internal/pycore_unicodeobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ _PyUnicodeWriter_WriteCharInline(_PyUnicodeWriter *writer, Py_UCS4 ch)
7777

7878
/* --- Characters Type APIs ----------------------------------------------- */
7979

80-
PyAPI_FUNC(int) _PyUnicode_IsXidStart(Py_UCS4 ch);
81-
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(Py_UCS4 ch);
80+
extern int _PyUnicode_IsXidStart(Py_UCS4 ch);
81+
extern int _PyUnicode_IsXidContinue(Py_UCS4 ch);
8282
extern int _PyUnicode_ToLowerFull(Py_UCS4 ch, Py_UCS4 *res);
8383
extern int _PyUnicode_ToTitleFull(Py_UCS4 ch, Py_UCS4 *res);
8484
extern int _PyUnicode_ToUpperFull(Py_UCS4 ch, Py_UCS4 *res);

Makefile.pre.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ PYTHON_HEADERS= \
14331433
$(srcdir)/Include/internal/pycore_typeobject.h \
14341434
$(srcdir)/Include/internal/pycore_typevarobject.h \
14351435
$(srcdir)/Include/internal/pycore_ucnhash.h \
1436+
$(srcdir)/Include/internal/pycore_unicodedata.h \
14361437
$(srcdir)/Include/internal/pycore_unicodeobject.h \
14371438
$(srcdir)/Include/internal/pycore_unicodeobject_generated.h \
14381439
$(srcdir)/Include/internal/pycore_unionobject.h \

Modules/unicodedata.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "Python.h"
2020
#include "pycore_object.h" // _PyObject_VisitType()
2121
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
22+
#include "pycore_unicodedata.h" // _PyUnicode_IsXidStart, _PyUnicode_IsXidContinue
2223

2324
#include <stdbool.h>
2425
#include <stddef.h> // offsetof()

Objects/unicodectype.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include "Python.h"
12+
#include "pycore_unicodedata.h" // _PyUnicode_IsXidStart, _PyUnicode_IsXidContinue
1213

1314
#define ALPHA_MASK 0x01
1415
#define DECIMAL_MASK 0x02

PCbuild/pythoncore.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@
328328
<ClInclude Include="..\Include\internal\pycore_typevarobject.h" />
329329
<ClInclude Include="..\Include\internal\pycore_ucnhash.h" />
330330
<ClInclude Include="..\Include\internal\pycore_unionobject.h" />
331+
<ClInclude Include="..\Include\internal\pycore_unicodedata.h" />
331332
<ClInclude Include="..\Include\internal\pycore_unicodeobject.h" />
332333
<ClInclude Include="..\Include\internal\pycore_unicodeobject_generated.h" />
333334
<ClInclude Include="..\Include\internal\pycore_uniqueid.h" />

0 commit comments

Comments
 (0)