From 66c389c590ed7a0c84eefe76c5db500cf3bbddf3 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Tue, 10 Jan 2017 19:43:48 +0000 Subject: [PATCH] Correct preprocessor logic; fix bug [#2322] --- mingwrt/ChangeLog | 7 +++++++ mingwrt/include/strings.h | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index df2e26e..e285d3c 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,10 @@ +2017-01-10 Keith Marshall + + Correct preprocessor logic; fix bug [#2322] + + * include/strings.h (_stricmp, _strnicmp): Always declare, unless... + [__STRICT_ANSI__ && __NO_INLINE__]: ...both of these are defined. + 2016-11-28 Keith Marshall Implement POSIX.1 compatible setenv() and unsetenv() functions. diff --git a/mingwrt/include/strings.h b/mingwrt/include/strings.h index 8b790a3..0d10628 100644 --- a/mingwrt/include/strings.h +++ b/mingwrt/include/strings.h @@ -6,7 +6,7 @@ * $Id$ * * Written by Keith Marshall - * Copyright (C) 2015, 2016, MinGW.org Project. + * Copyright (C) 2015-2017, MinGW.org Project. * * * Permission is hereby granted, free of charge, to any person obtaining a @@ -66,17 +66,20 @@ int __cdecl __MINGW_NOTHROW strncasecmp( const char *, const char *, size_t ); #endif /* ! RC_INVOKED */ #endif /* !__STRING_H_SOURCED__ */ -#if ! (defined _STRINGS_H && defined __NO_INLINE__) +#if ! (defined __STRICT_ANSI__ && defined __NO_INLINE__) /* These are the MSVCRT.DLL equivalents for POSIX.1's strcasecmp() and * strncasecmp() functions, for which we provide in-line implementations * in respectively; MSVC expects to find these prototypes in * , but we also need them here, in , to facilitate * the in-line function implementations; we declare them here, and allow - * to include them selectively. + * to include them selectively. Note that doesn't + * need these if __STRICT_ANSI__ is defined, while doesn't + * if __NO_INLINE__ is defined; thus we declare them, unless BOTH of + * these conditions for not requiring them are satisfied. */ _CRTIMP __cdecl __MINGW_NOTHROW int _stricmp( const char *, const char * ); _CRTIMP __cdecl __MINGW_NOTHROW int _strnicmp( const char *, const char *, size_t ); -#endif /* !(_STRINGS_H && __NO_INLINE__) */ +#endif /* !(__STRICT_ANSI__ && __NO_INLINE__) */ #if defined _STRINGS_H && ! defined RC_INVOKED #ifndef __NO_INLINE__ -- 2.11.0