Skip to content

Commit

Permalink
Detect 'isascii' at configuration stage
Browse files Browse the repository at this point in the history
Previously platforms without isascii had to manually
indicate it's absence with `NO_STDLIB_ISASCII` define.

It is trivial to detect function availability, so do that.
  • Loading branch information
redbaron committed Nov 7, 2024
1 parent c577ad7 commit 75f6a93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ check_function_exists("socket" HAVE_SOCKET)
check_function_exists("strftime" HAVE_STRFTIME)
check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC)

include(CheckSymbolExists)
check_symbol_exists(isascii "ctype.h" HAVE_ISASCII)

include(CheckTypeSize)

check_type_size("__uint128_t" __UINT128_T)
Expand Down
1 change: 0 additions & 1 deletion wolfssl/wolfcrypt/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -2504,7 +2504,6 @@ extern void uITRON4_free(void *p) ;
#define WOLFSSL_DH_CONST
#define WOLFSSL_HAVE_MAX
#define NO_WRITEV
#define NO_STDLIB_ISASCII

#define USE_FLAT_BENCHMARK_H
#define USE_FLAT_TEST_H
Expand Down
2 changes: 1 addition & 1 deletion wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ typedef struct w64wrapper {
#endif
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
#define XISALNUM(c) isalnum((c))
#ifdef NO_STDLIB_ISASCII
#ifndef HAVE_ISASCII
#define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0)
#else
#define XISASCII(c) isascii((c))
Expand Down

0 comments on commit 75f6a93

Please sign in to comment.