-
Notifications
You must be signed in to change notification settings - Fork 835
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect 'isascii' at configuration stage #8158
base: master
Are you sure you want to change the base?
Conversation
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.
Can one of the admins verify this patch? |
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just occurred to me, that HAVE_ISASCII
is stored in config.h
which is optional. Maybe this define should stay as is?
@redbaron is approved as a wolfSSL contributor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an improvement to me, but you do need to accommodate autotools too:
diff --git a/configure.ac b/configure.ac
index 16af3bb24..7b0e35912 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,7 +119,7 @@ then
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_EXPERIMENTAL_SETTINGS"
fi
-AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h])
+AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h ctype.h])
AC_CHECK_LIB([network],[socket])
AC_C_BIGENDIAN
AC_C___ATOMIC
@@ -128,8 +128,8 @@ AC_CHECK_HEADER(stdatomic.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ATOMIC_H"
# check if functions of interest are linkable, but also check if
# they're declared by the expected headers, and if not, supersede the
# unusable positive from AC_CHECK_FUNCS().
-AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit])
-AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit], [], [
+AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit isascii])
+AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit, isascii], [], [
if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
then
AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
@@ -159,6 +159,9 @@ fi
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
+#ifdef HAVE_CTYPE_H
+ #include <ctype.h>
+#endif
]])
AC_PROG_INSTALL
Description
Detect 'isascii' at configuration stage
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.
Testing
Built on platform with no
isascii
availableChecklist