diff --git a/bypy/linux/launcher.c b/bypy/linux/launcher.c index 5e7ef57def..fc9cbbf7c6 100644 --- a/bypy/linux/launcher.c +++ b/bypy/linux/launcher.c @@ -5,6 +5,7 @@ * Distributed under terms of the GPL3 license. */ +#define PY_SSIZE_T_CLEAN #include #include #include diff --git a/bypy/macos/launcher.c b/bypy/macos/launcher.c index 165b11c303..a03b778d00 100644 --- a/bypy/macos/launcher.c +++ b/bypy/macos/launcher.c @@ -1,3 +1,4 @@ +#define PY_SSIZE_T_CLEAN #include "util.h" #include #include diff --git a/bypy/run-python.h b/bypy/run-python.h index cae241b539..6d55b3c972 100644 --- a/bypy/run-python.h +++ b/bypy/run-python.h @@ -5,7 +5,7 @@ */ #pragma once - +#define PY_SSIZE_T_CLEAN #include #include #include diff --git a/bypy/windows/util.c b/bypy/windows/util.c index 8ecff90909..70f2abbe43 100644 --- a/bypy/windows/util.c +++ b/bypy/windows/util.c @@ -3,6 +3,7 @@ */ #define UNICODE +#define PY_SSIZE_T_CLEAN #define _WIN32_WINNT 0x0502 #define WINDOWS_LEAN_AND_MEAN diff --git a/src/calibre/devices/libusb/libusb.c b/src/calibre/devices/libusb/libusb.c index bd159ec73d..7d1f2c2274 100644 --- a/src/calibre/devices/libusb/libusb.c +++ b/src/calibre/devices/libusb/libusb.c @@ -6,6 +6,7 @@ */ #define UNICODE +#define PY_SSIZE_T_CLEAN #include #ifdef __FreeBSD__ diff --git a/src/calibre/devices/mtp/unix/libmtp.c b/src/calibre/devices/mtp/unix/libmtp.c index df653c67bd..faed4424ea 100644 --- a/src/calibre/devices/mtp/unix/libmtp.c +++ b/src/calibre/devices/mtp/unix/libmtp.c @@ -6,6 +6,7 @@ */ +#define PY_SSIZE_T_CLEAN #define UNICODE #include #include diff --git a/src/calibre/devices/mtp/windows/global.h b/src/calibre/devices/mtp/windows/global.h index 30ed76f342..9660b21c40 100644 --- a/src/calibre/devices/mtp/windows/global.h +++ b/src/calibre/devices/mtp/windows/global.h @@ -7,6 +7,7 @@ #pragma once #define UNICODE +#define PY_SSIZE_T_CLEAN #include #include #include diff --git a/src/calibre/devices/usbobserver/usbobserver.c b/src/calibre/devices/usbobserver/usbobserver.c index 89f23c4a59..716ed61745 100644 --- a/src/calibre/devices/usbobserver/usbobserver.c +++ b/src/calibre/devices/usbobserver/usbobserver.c @@ -20,6 +20,8 @@ */ #define _DARWIN_USE_64_BIT_INODE +#define PY_SSIZE_T_CLEAN + #include #include diff --git a/src/calibre/gui2/tts/nsss.m b/src/calibre/gui2/tts/nsss.m index 805b8a6c78..ee19fe5614 100644 --- a/src/calibre/gui2/tts/nsss.m +++ b/src/calibre/gui2/tts/nsss.m @@ -4,6 +4,7 @@ * * Distributed under terms of the GPL3 license. */ +#define PY_SSIZE_T_CLEAN #include #import diff --git a/src/calibre/gui2/tweak_book/diff/_patiencediff_c.c b/src/calibre/gui2/tweak_book/diff/_patiencediff_c.c index aa64c71efa..7ce4d98fce 100644 --- a/src/calibre/gui2/tweak_book/diff/_patiencediff_c.c +++ b/src/calibre/gui2/tweak_book/diff/_patiencediff_c.c @@ -22,6 +22,7 @@ Copyright (C) 2005 Bram Cohen, Copyright (C) 2005, 2006 Canonical Ltd */ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/library/sqlite_custom.c b/src/calibre/library/sqlite_custom.c index 9ed40a2b61..e4383129b0 100644 --- a/src/calibre/library/sqlite_custom.c +++ b/src/calibre/library/sqlite_custom.c @@ -1,4 +1,5 @@ #define UNICODE +#define PY_SSIZE_T_CLEAN #include diff --git a/src/calibre/srv/html_as_json.cpp b/src/calibre/srv/html_as_json.cpp index 9cfaa0f17b..1ffd133a94 100644 --- a/src/calibre/srv/html_as_json.cpp +++ b/src/calibre/srv/html_as_json.cpp @@ -4,6 +4,7 @@ * * Distributed under terms of the GPL3 license. */ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/certgen.c b/src/calibre/utils/certgen.c index 7955a0f0f8..72a6728182 100644 --- a/src/calibre/utils/certgen.c +++ b/src/calibre/utils/certgen.c @@ -6,6 +6,7 @@ */ #define UNICODE +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/cocoa.m b/src/calibre/utils/cocoa.m index f2ef2670de..888e0f95a2 100644 --- a/src/calibre/utils/cocoa.m +++ b/src/calibre/utils/cocoa.m @@ -5,6 +5,7 @@ * Distributed under terms of the GPL3 license. */ +#define PY_SSIZE_T_CLEAN #import #import #import diff --git a/src/calibre/utils/hyphenation/hyphen.c b/src/calibre/utils/hyphenation/hyphen.c index 2dbecd9265..d91ad33dc8 100644 --- a/src/calibre/utils/hyphenation/hyphen.c +++ b/src/calibre/utils/hyphenation/hyphen.c @@ -5,6 +5,7 @@ * Distributed under terms of the GPL3 license. */ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/imageops/imageops.h b/src/calibre/utils/imageops/imageops.h index 208cb6ef03..9a5578230e 100644 --- a/src/calibre/utils/imageops/imageops.h +++ b/src/calibre/utils/imageops/imageops.h @@ -6,6 +6,7 @@ */ #pragma once +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/lzx/compressor.c b/src/calibre/utils/lzx/compressor.c index c9fba107d1..6f43bbc3c9 100644 --- a/src/calibre/utils/lzx/compressor.c +++ b/src/calibre/utils/lzx/compressor.c @@ -3,6 +3,7 @@ * * Python/C implementation of an LZX compressor type. */ +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/lzx/lzxmodule.c b/src/calibre/utils/lzx/lzxmodule.c index 6b8910e563..bb18277ccf 100644 --- a/src/calibre/utils/lzx/lzxmodule.c +++ b/src/calibre/utils/lzx/lzxmodule.c @@ -3,6 +3,7 @@ * * Python module C glue code. */ +#define PY_SSIZE_T_CLEAN #include diff --git a/src/calibre/utils/msdes/msdesmodule.c b/src/calibre/utils/msdes/msdesmodule.c index dd9145ac95..a69ff19ea2 100644 --- a/src/calibre/utils/msdes/msdesmodule.c +++ b/src/calibre/utils/msdes/msdesmodule.c @@ -4,7 +4,7 @@ * Python module C glue code. */ - +#define PY_SSIZE_T_CLEAN #include #include diff --git a/src/calibre/utils/speedup.c b/src/calibre/utils/speedup.c index ff5c55a690..ef6d87c752 100644 --- a/src/calibre/utils/speedup.c +++ b/src/calibre/utils/speedup.c @@ -1,4 +1,6 @@ #define UNICODE +#define PY_SSIZE_T_CLEAN + #include #include #include diff --git a/src/calibre/utils/spell/hunspell_wrapper.cpp b/src/calibre/utils/spell/hunspell_wrapper.cpp index 371c65e963..0a672fd6d6 100644 --- a/src/calibre/utils/spell/hunspell_wrapper.cpp +++ b/src/calibre/utils/spell/hunspell_wrapper.cpp @@ -6,7 +6,7 @@ * Distributed under terms of the GPL3 license. */ -#define PY_SSIZE_T_CLEAN 1 +#define PY_SSIZE_T_CLEAN #include #include #include diff --git a/src/unicode_names/data-types.h b/src/unicode_names/data-types.h index 264ef25aff..cf743c6b67 100644 --- a/src/unicode_names/data-types.h +++ b/src/unicode_names/data-types.h @@ -5,6 +5,7 @@ */ #pragma once +#define PY_SSIZE_T_CLEAN #include #include