bpo-28269: Replace strcasecmp with system function stricmp by gongminmin · Pull Request #13095 · python/cpython (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation10 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
The idea is from a comment in the issue. Replace strcasecmp in Python/dynload_win.c to posix stricmp,
- MinGW can compile this file,
- Don't need to maintain strcasecmp,
- No #ifdef/#endif. The code is converged between compilers.
https://bugs.python.org/issue28269
Microsoft deprecated stricmp
and recommends using _stricmp
instead.
Just tried, MinGW also accept _stricmp. I'll use it instead. Thanks @serhiy-storchaka .
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @gongminmin :)
@skrah, do you think it is worth deleting those lines too?
#undef strcasecmp |
---|
#define strcasecmp _stricmp |
And also update this comment to remove any occurrences of strcasecmp
?
* Work around the behavior of tolower() and strcasecmp() in certain |
---|
Co-Authored-By: Mickaël Schoentgen contact@tiger-222.fr
@skrah, do you think it is worth deleting those lines too?
No, vccompat.h
intentionally translates MSVC functions to Unix functions. Also, libmpdec
needs to stay in sync with upstream. But the current code organization is absolutely deliberate.
Thanks @gongminmin for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 2.7, 3.7, 3.8.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit 05f2d84)
Co-authored-by: Minmin Gong gongminmin@msn.com
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
(cherry picked from commit 05f2d84)
Co-authored-by: Minmin Gong gongminmin@msn.com
Sorry, @gongminmin and @serhiy-storchaka, I could not cleanly backport this to 2.7
due to a conflict.
Please backport using cherry_picker on command line.cherry_picker 05f2d84cae4ba1ff15b7a1d0347305393f4bdcc5 2.7
miss-islington added a commit that referenced this pull request
(cherry picked from commit 05f2d84)
Co-authored-by: Minmin Gong gongminmin@msn.com
lisroach pushed a commit to lisroach/cpython that referenced this pull request
DinoV pushed a commit to DinoV/cpython that referenced this pull request
jcfr added a commit to python-cmake-buildsystem/cpython that referenced this pull request
This commit integrates changes originally added to the project as python-cmake-buildsystem/python-cmake-buildsystem@18d49757e (Mingw32 support, and add cmake options for disabling)
Note that in more recent version of Python, this patch is obsoleted by the following commits:
See python/cpython@589f89e2a (introduced in 3.3) Removed a Windows 9x trick used before LoadLibraryExW. Windows 9x has long been unsupported and the result of GetFullPathName was not even being used in the first place.
See python/cpython@05f2d84ca (introduced in 3.9) bpo-28269: Replace strcasecmp with system function _stricmp. (pythonGH-13095)
Co-authored-by: David Sansome me@davidsansome.com
jcfr added a commit to python-cmake-buildsystem/cpython that referenced this pull request
This commit integrates changes originally added to the project as python-cmake-buildsystem/python-cmake-buildsystem@18d49757e (Mingw32 support, and add cmake options for disabling)
Note that in more recent version of Python, this patch is obsoleted by the following commits:
See python/cpython@589f89e2a (introduced in 3.3) Removed a Windows 9x trick used before LoadLibraryExW. Windows 9x has long been unsupported and the result of GetFullPathName was not even being used in the first place.
See python/cpython@05f2d84ca (introduced in 3.9) bpo-28269: Replace strcasecmp with system function _stricmp. (pythonGH-13095)
Co-authored-by: David Sansome me@davidsansome.com
jcfr added a commit to python-cmake-buildsystem/cpython that referenced this pull request
This commit integrates changes originally added to the project as python-cmake-buildsystem/python-cmake-buildsystem@18d49757e (Mingw32 support, and add cmake options for disabling)
Note that in more recent version of Python, this patch is obsoleted by the following commits:
See python/cpython@589f89e2a (introduced in 3.3) Removed a Windows 9x trick used before LoadLibraryExW. Windows 9x has long been unsupported and the result of GetFullPathName was not even being used in the first place.
See python/cpython@05f2d84ca (introduced in 3.9) bpo-28269: Replace strcasecmp with system function _stricmp. (pythonGH-13095)
Co-authored-by: David Sansome me@davidsansome.com
jcfr added a commit to python-cmake-buildsystem/cpython that referenced this pull request
This commit integrates changes originally added to the project as python-cmake-buildsystem/python-cmake-buildsystem@18d49757e (Mingw32 support, and add cmake options for disabling)
Note that in more recent version of Python, this patch is obsoleted by the following commits:
See python/cpython@589f89e2a (introduced in 3.3) Removed a Windows 9x trick used before LoadLibraryExW. Windows 9x has long been unsupported and the result of GetFullPathName was not even being used in the first place.
See python/cpython@05f2d84ca (introduced in 3.9) bpo-28269: Replace strcasecmp with system function _stricmp. (pythonGH-13095)
Co-authored-by: David Sansome me@davidsansome.com