mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-13 19:57:05 +08:00
introduce 'lwip_tolower' and use it in dns.c
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
@@ -221,12 +221,15 @@ typedef int ssize_t;
|
||||
#define lwip_isxdigit(c) (lwip_isdigit(c) || lwip_in_range((c), 'a', 'f') || lwip_in_range((c), 'A', 'F'))
|
||||
#define lwip_islower(c) lwip_in_range((c), 'a', 'z')
|
||||
#define lwip_isspace(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || (c) == '\t' || (c) == '\v')
|
||||
#define lwip_isupper(c) lwip_in_range((c), 'A', 'Z')
|
||||
#define lwip_tolower(c) (lwip_isupper(c) ? (c) - 'A' + 'a' : c)
|
||||
#else
|
||||
#include <ctype.h>
|
||||
#define lwip_isdigit(c) isdigit((unsigned char)(c))
|
||||
#define lwip_isxdigit(c) isxdigit((unsigned char)(c))
|
||||
#define lwip_islower(c) islower((unsigned char)(c))
|
||||
#define lwip_isspace(c) isspace((unsigned char)(c))
|
||||
#define lwip_tolower(c) tolower(c)
|
||||
#endif
|
||||
|
||||
/** C++ const_cast<target_type>(val) equivalent to remove constness from a value (GCC -Wcast-qual) */
|
||||
|
||||
Reference in New Issue
Block a user