]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43444: Move sqlite3 MODULE_NAME from setup.py to module.h (GH-24801)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Sat, 13 Mar 2021 15:33:39 +0000 (16:33 +0100)
committerGitHub <noreply@github.com>
Sat, 13 Mar 2021 15:33:39 +0000 (17:33 +0200)
Modules/_sqlite/cache.h
Modules/_sqlite/module.h
Modules/_sqlite/prepare_protocol.h
PCbuild/_sqlite3.vcxproj
setup.py

index 4a1977fcd2cd23846500dfa753f7b05300fa4c37..083356f93f9e4cf53cc65e3f2e6fbeeee1ecc387 100644 (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
index 3185ec978885676830e6b251da9604628969b28d..9aede92ea33c9e8243e0c9bf32a0bf578acc7143 100644 (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;
index 42d07cbe9f16feaae3f021e396dd5a0506d79946..593961331c90da1013b993f9e3882e388d36d0d3 100644 (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
 {
index 7e0062692b8f839d798a178afb86f3edad477dc8..5eb8559d2925ec940939950f6feeb40da17808b1 100644 (file)
@@ -94,7 +94,6 @@
   <ItemDefinitionGroup>
     <ClCompile>
       <AdditionalIncludeDirectories>$(sqlite3Dir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>MODULE_NAME="sqlite3";%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
index 554772217785db9c396c71886e672cb0da52c0ee..3467f559e5808c04d066602c63e5ccad9b262cbb 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1571,12 +1571,7 @@ class PyBuildExt(build_ext):
                 '_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.