gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 01/02: Fixed possible preprocessor errors


From: gnunet
Subject: [libmicrohttpd] 01/02: Fixed possible preprocessor errors
Date: Thu, 02 Sep 2021 09:45:58 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit aaab73802c5f05d231d87ab9d401e6b262c6fe2e
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 1 19:47:06 2021 +0300

    Fixed possible preprocessor errors
---
 configure.ac                | 1 +
 src/microhttpd/connection.c | 4 ++--
 src/microhttpd/daemon.c     | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 76903382..ec27649d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1102,6 +1102,7 @@ static struct timeval test_var;
 AC_DEFINE_UNQUOTED([SIZEOF_STRUCT_TIMEVAL_TV_SEC], 
[$mhd_cv_size_timeval_tv_sec],
   [The size of `tv_sec' member of `struct timeval', as computed by sizeof])
 AC_CHECK_SIZEOF([uint64_t], [], [[#include <stdint.h>]])
+AC_CHECK_SIZEOF([unsigned int], [], [[#include <stdint.h>]])
 
 AC_CHECK_HEADERS([dlfcn.h],[have_tlsplugin=yes],[have_tlsplugin=no], 
[AC_INCLUDES_DEFAULT])
 AM_CONDITIONAL([MHD_HAVE_TLS_PLUGIN], [[test "x$have_tlsplugin" = xyes]])
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index de81f08a..e16eec27 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4782,7 +4782,7 @@ MHD_set_connection_option (struct MHD_Connection 
*connection,
     connection->connection_timeout_ms = va_arg (ap,
                                                 unsigned int);
     va_end (ap);
-#if (0 == (UINT64_MAX + 0)) || ((UINT_MAX + 0) >= (UINT64_MAX + 0))
+#if (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT
     if ((UINT64_MAX / 2000 - 1) < connection->connection_timeout_ms)
     {
 #ifdef HAVE_MESSAGES
@@ -4796,7 +4796,7 @@ MHD_set_connection_option (struct MHD_Connection 
*connection,
       connection->connection_timeout_ms = UINT64_MAX / 2000 - 1;
     }
     else
-#endif /* UINTMAX_MAX >= UINT64_MAX */
+#endif /* (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT */
     connection->connection_timeout_ms *= 1000;
     if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
          (! connection->suspended) )
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index bec6d8d8..83110dd3 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -5624,7 +5624,7 @@ parse_options_va (struct MHD_Daemon *daemon,
     case MHD_OPTION_CONNECTION_TIMEOUT:
       uv = va_arg (ap,
                    unsigned int);
-#if (0 == (UINT64_MAX + 0)) || ((UINT_MAX + 0) >= (UINT64_MAX + 0))
+#if (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT
       if ((UINT64_MAX / 2000 - 1) < uv)
       {
 #ifdef HAVE_MESSAGES
@@ -5638,7 +5638,7 @@ parse_options_va (struct MHD_Daemon *daemon,
         daemon->connection_timeout_ms = UINT64_MAX / 2000 - 1;
       }
       else
-#endif /* UINTMAX_MAX >= UINT64_MAX */
+#endif /* (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT */
       daemon->connection_timeout_ms = uv * 1000;
       break;
     case MHD_OPTION_NOTIFY_COMPLETED:

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]