bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801)

This commit is contained in:
Erlend Egeberg Aasland 2021-03-13 16:33:39 +01:00 committed by GitHub
parent 75048c8a38
commit 2256a2876b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 10 deletions

View file

@ -23,8 +23,7 @@
#ifndef PYSQLITE_CACHE_H
#define PYSQLITE_CACHE_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "module.h"
/* The LRU cache is implemented as a combination of a doubly-linked with a
* dictionary. The list items are of type 'Node' and the dictionary has the

View file

@ -27,6 +27,7 @@
#include "Python.h"
#define PYSQLITE_VERSION "2.6.0"
#define MODULE_NAME "sqlite3"
extern PyObject* pysqlite_Error;
extern PyObject* pysqlite_Warning;

View file

@ -23,8 +23,7 @@
#ifndef PYSQLITE_PREPARE_PROTOCOL_H
#define PYSQLITE_PREPARE_PROTOCOL_H
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "module.h"
typedef struct
{

View file

@ -94,7 +94,6 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(sqlite3Dir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MODULE_NAME="sqlite3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>

View file

@ -1571,12 +1571,7 @@ def detect_sqlite(self):
'_sqlite/row.c',
'_sqlite/statement.c',
'_sqlite/util.c', ]
sqlite_defines = []
if not MS_WINDOWS:
sqlite_defines.append(('MODULE_NAME', '"sqlite3"'))
else:
sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
# Enable support for loadable extensions in the sqlite3 module
# if --enable-loadable-sqlite-extensions configure option is used.