summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-02 11:50:17 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-02 11:50:17 -0400
commitc8ccd028a78d154c3b82138f7827aec0e2de13dd (patch)
tree6cc5d2cbf3672b82db8e01029351a4ef9ddf9c34 /configure.ac
parentcb1a3674ebb3826d9e1e56146210bd79cb4a42f0 (diff)
downloadtor-c8ccd028a78d154c3b82138f7827aec0e2de13dd.tar.gz
tor-c8ccd028a78d154c3b82138f7827aec0e2de13dd.zip
Don't redefine str(n)casecmp on windows unless they're missing
When we do redefine them, use inline functions instead of #define. This fixes a latent code problem in our redefinition of these functions, which was exposed by our refactoring: Previously, we would #define strcasecmp after string.h was included, so nothing bad would happen. But when we refactored, we would sometimes #define it first, which was a problem on mingw, whose headers contain (approximately): inline int strcasecmp (const char *a, const char *b) { return _stricmp(a,b); } Our define turned this into: inline int _stricmp(const char *a, const char *b) { return _stricmp(a,b); } And GCC would correctly infer that this function would loop forever, rather than actually comparing anything. This caused bug 26594. Fixes bug 26594; bug not in any released version of Tor.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 97e8dadeba..98635bcbd8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -610,6 +610,8 @@ AC_CHECK_FUNCS(
sigaction \
socketpair \
statvfs \
+ strncasecmp \
+ strcasecmp \
strlcat \
strlcpy \
strnlen \