summaryrefslogtreecommitdiff
path: root/Objects/stringlib/stringdefs.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-23 15:54:35 +0200
committerGitHub <noreply@github.com>2020-06-23 15:54:35 +0200
commitc41eed1a874e2f22bde45c3c89418414b7a37f46 (patch)
treee90ff0bf1c5349169f3f04c914695b3c4b476f37 /Objects/stringlib/stringdefs.h
parent32f2eda85957365d208f499b730d30b7eb419741 (diff)
downloadcpython-git-c41eed1a874e2f22bde45c3c89418414b7a37f46.tar.gz
bpo-40521: Make bytes singletons per interpreter (GH-21074)
Each interpreter now has its own empty bytes string and single byte character singletons. Replace STRINGLIB_EMPTY macro with STRINGLIB_GET_EMPTY() macro.
Diffstat (limited to 'Objects/stringlib/stringdefs.h')
-rw-r--r--Objects/stringlib/stringdefs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/stringlib/stringdefs.h b/Objects/stringlib/stringdefs.h
index ce27f3e408..c12ecc59e5 100644
--- a/Objects/stringlib/stringdefs.h
+++ b/Objects/stringlib/stringdefs.h
@@ -1,6 +1,10 @@
#ifndef STRINGLIB_STRINGDEFS_H
#define STRINGLIB_STRINGDEFS_H
+#ifndef STRINGLIB_GET_EMPTY
+# error "STRINGLIB_GET_EMPTY macro must be defined"
+#endif
+
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */
@@ -13,7 +17,6 @@
#define STRINGLIB_CHAR char
#define STRINGLIB_TYPE_NAME "string"
#define STRINGLIB_PARSE_CODE "S"
-#define STRINGLIB_EMPTY nullstring
#define STRINGLIB_ISSPACE Py_ISSPACE
#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))