diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-01 19:47:06 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-02 10:45:38 +0300 |
commit | aaab73802c5f05d231d87ab9d401e6b262c6fe2e (patch) | |
tree | 3c9283fe7a858ef51c1e94345b48ebdcdc66521a | |
parent | 0920a1f90865073a20d6e9822fca18ffe5f46d2e (diff) | |
download | libmicrohttpd-aaab73802c5f05d231d87ab9d401e6b262c6fe2e.tar.gz libmicrohttpd-aaab73802c5f05d231d87ab9d401e6b262c6fe2e.zip |
Fixed possible preprocessor errors
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/microhttpd/connection.c | 4 | ||||
-rw-r--r-- | 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; | |||
1102 | AC_DEFINE_UNQUOTED([SIZEOF_STRUCT_TIMEVAL_TV_SEC], [$mhd_cv_size_timeval_tv_sec], | 1102 | AC_DEFINE_UNQUOTED([SIZEOF_STRUCT_TIMEVAL_TV_SEC], [$mhd_cv_size_timeval_tv_sec], |
1103 | [The size of `tv_sec' member of `struct timeval', as computed by sizeof]) | 1103 | [The size of `tv_sec' member of `struct timeval', as computed by sizeof]) |
1104 | AC_CHECK_SIZEOF([uint64_t], [], [[#include <stdint.h>]]) | 1104 | AC_CHECK_SIZEOF([uint64_t], [], [[#include <stdint.h>]]) |
1105 | AC_CHECK_SIZEOF([unsigned int], [], [[#include <stdint.h>]]) | ||
1105 | 1106 | ||
1106 | AC_CHECK_HEADERS([dlfcn.h],[have_tlsplugin=yes],[have_tlsplugin=no], [AC_INCLUDES_DEFAULT]) | 1107 | AC_CHECK_HEADERS([dlfcn.h],[have_tlsplugin=yes],[have_tlsplugin=no], [AC_INCLUDES_DEFAULT]) |
1107 | AM_CONDITIONAL([MHD_HAVE_TLS_PLUGIN], [[test "x$have_tlsplugin" = xyes]]) | 1108 | 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, | |||
4782 | connection->connection_timeout_ms = va_arg (ap, | 4782 | connection->connection_timeout_ms = va_arg (ap, |
4783 | unsigned int); | 4783 | unsigned int); |
4784 | va_end (ap); | 4784 | va_end (ap); |
4785 | #if (0 == (UINT64_MAX + 0)) || ((UINT_MAX + 0) >= (UINT64_MAX + 0)) | 4785 | #if (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT |
4786 | if ((UINT64_MAX / 2000 - 1) < connection->connection_timeout_ms) | 4786 | if ((UINT64_MAX / 2000 - 1) < connection->connection_timeout_ms) |
4787 | { | 4787 | { |
4788 | #ifdef HAVE_MESSAGES | 4788 | #ifdef HAVE_MESSAGES |
@@ -4796,7 +4796,7 @@ MHD_set_connection_option (struct MHD_Connection *connection, | |||
4796 | connection->connection_timeout_ms = UINT64_MAX / 2000 - 1; | 4796 | connection->connection_timeout_ms = UINT64_MAX / 2000 - 1; |
4797 | } | 4797 | } |
4798 | else | 4798 | else |
4799 | #endif /* UINTMAX_MAX >= UINT64_MAX */ | 4799 | #endif /* (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT */ |
4800 | connection->connection_timeout_ms *= 1000; | 4800 | connection->connection_timeout_ms *= 1000; |
4801 | if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && | 4801 | if ( (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) && |
4802 | (! connection->suspended) ) | 4802 | (! 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, | |||
5624 | case MHD_OPTION_CONNECTION_TIMEOUT: | 5624 | case MHD_OPTION_CONNECTION_TIMEOUT: |
5625 | uv = va_arg (ap, | 5625 | uv = va_arg (ap, |
5626 | unsigned int); | 5626 | unsigned int); |
5627 | #if (0 == (UINT64_MAX + 0)) || ((UINT_MAX + 0) >= (UINT64_MAX + 0)) | 5627 | #if (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT |
5628 | if ((UINT64_MAX / 2000 - 1) < uv) | 5628 | if ((UINT64_MAX / 2000 - 1) < uv) |
5629 | { | 5629 | { |
5630 | #ifdef HAVE_MESSAGES | 5630 | #ifdef HAVE_MESSAGES |
@@ -5638,7 +5638,7 @@ parse_options_va (struct MHD_Daemon *daemon, | |||
5638 | daemon->connection_timeout_ms = UINT64_MAX / 2000 - 1; | 5638 | daemon->connection_timeout_ms = UINT64_MAX / 2000 - 1; |
5639 | } | 5639 | } |
5640 | else | 5640 | else |
5641 | #endif /* UINTMAX_MAX >= UINT64_MAX */ | 5641 | #endif /* (SIZEOF_UINT64_T - 1) <= SIZEOF_UNSIGNED_INT */ |
5642 | daemon->connection_timeout_ms = uv * 1000; | 5642 | daemon->connection_timeout_ms = uv * 1000; |
5643 | break; | 5643 | break; |
5644 | case MHD_OPTION_NOTIFY_COMPLETED: | 5644 | case MHD_OPTION_NOTIFY_COMPLETED: |