From 29198ea1c6d58f87389136b0ac0b8b2318dbac24 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Mar 2019 22:10:18 +0900 Subject: [PATCH] bpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434) Modules/_sqlite/cursor.c uses "y#" format. It didn't declare PY_SSIZE_T_CLEAN, but the argument is Py_ssize_t already. --- Modules/_sqlite/cache.h | 1 + Modules/_sqlite/connection.h | 1 + Modules/_sqlite/cursor.h | 1 + Modules/_sqlite/microprotocols.h | 1 + Modules/_sqlite/module.h | 1 + Modules/_sqlite/prepare_protocol.h | 1 + Modules/_sqlite/row.h | 1 + Modules/_sqlite/statement.h | 1 + Modules/_sqlite/util.h | 1 + 9 files changed, 9 insertions(+) diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h index a133903961da..529010967c4f 100644 --- a/Modules/_sqlite/cache.h +++ b/Modules/_sqlite/cache.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_CACHE_H #define PYSQLITE_CACHE_H +#define PY_SSIZE_T_CLEAN #include "Python.h" /* The LRU cache is implemented as a combination of a doubly-linked with a diff --git a/Modules/_sqlite/connection.h b/Modules/_sqlite/connection.h index 5fb410a62e53..4e9d94c5f308 100644 --- a/Modules/_sqlite/connection.h +++ b/Modules/_sqlite/connection.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_CONNECTION_H #define PYSQLITE_CONNECTION_H +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "pythread.h" #include "structmember.h" diff --git a/Modules/_sqlite/cursor.h b/Modules/_sqlite/cursor.h index 28bbd5f91175..4a20e756f782 100644 --- a/Modules/_sqlite/cursor.h +++ b/Modules/_sqlite/cursor.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_CURSOR_H #define PYSQLITE_CURSOR_H +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "statement.h" diff --git a/Modules/_sqlite/microprotocols.h b/Modules/_sqlite/microprotocols.h index 99ff6f642b25..5418c2b98fd7 100644 --- a/Modules/_sqlite/microprotocols.h +++ b/Modules/_sqlite/microprotocols.h @@ -26,6 +26,7 @@ #ifndef PSYCOPG_MICROPROTOCOLS_H #define PSYCOPG_MICROPROTOCOLS_H 1 +#define PY_SSIZE_T_CLEAN #include /** the names of the three mandatory methods **/ diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h index 6f90934b325d..3185ec978885 100644 --- a/Modules/_sqlite/module.h +++ b/Modules/_sqlite/module.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_MODULE_H #define PYSQLITE_MODULE_H +#define PY_SSIZE_T_CLEAN #include "Python.h" #define PYSQLITE_VERSION "2.6.0" diff --git a/Modules/_sqlite/prepare_protocol.h b/Modules/_sqlite/prepare_protocol.h index 924e16223acf..3998a55e51ca 100644 --- a/Modules/_sqlite/prepare_protocol.h +++ b/Modules/_sqlite/prepare_protocol.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_PREPARE_PROTOCOL_H #define PYSQLITE_PREPARE_PROTOCOL_H +#define PY_SSIZE_T_CLEAN #include "Python.h" typedef struct diff --git a/Modules/_sqlite/row.h b/Modules/_sqlite/row.h index d014109032ad..4ad506f8dd96 100644 --- a/Modules/_sqlite/row.h +++ b/Modules/_sqlite/row.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_ROW_H #define PYSQLITE_ROW_H +#define PY_SSIZE_T_CLEAN #include "Python.h" typedef struct _Row diff --git a/Modules/_sqlite/statement.h b/Modules/_sqlite/statement.h index fd88d7d6622c..5002f02dc5b3 100644 --- a/Modules/_sqlite/statement.h +++ b/Modules/_sqlite/statement.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_STATEMENT_H #define PYSQLITE_STATEMENT_H +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "connection.h" diff --git a/Modules/_sqlite/util.h b/Modules/_sqlite/util.h index abaefd8b87b8..626191118f92 100644 --- a/Modules/_sqlite/util.h +++ b/Modules/_sqlite/util.h @@ -23,6 +23,7 @@ #ifndef PYSQLITE_UTIL_H #define PYSQLITE_UTIL_H +#define PY_SSIZE_T_CLEAN #include "Python.h" #include "pythread.h" #include "sqlite3.h" -- 2.47.3