diff --git a/src/include/platform.h b/src/include/platform.h index 472696b6..9e33ee70 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -206,12 +206,4 @@ typedef MHD_socket MHD_pipe; #define IPPROTO_IPV6 IPPROTO_IPV6 #endif -#ifndef OFF_T_MAX -#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1))) -#endif - -#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX) -#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1))) -#endif - #endif diff --git a/src/microhttpd/MHD_limits.h b/src/microhttpd/MHD_limits.h new file mode 100644 index 00000000..e809feff --- /dev/null +++ b/src/microhttpd/MHD_limits.h @@ -0,0 +1,49 @@ +/* + This file is part of libmicrohttpd + Copyright (C) 2015 Karlson2k (Evgeny Grin) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * @file microhttpd/MHD_limits.h + * @brief limits values definitions + * @author Karlson2k (Evgeny Grin) + */ + +#ifndef MHD_LIMITS_H +#define MHD_LIMITS_H + +#include "platform.h" + +#ifdef HAVE_LIMITS_H +#include +#endif /* HAVE_LIMITS_H */ + + +#ifndef INT32_MAX +#define INT32_MAX ((int32_t)0x7FFFFFFF) +#endif /* !INT32_MAX */ + +#ifndef OFF_T_MAX +#define OFF_T_MAX ((off_t) ~(((uint64_t) 1) << (8 * sizeof(off_t) - 1))) +#endif /* !OFF_T_MAX */ + +#if defined(_LARGEFILE64_SOURCE) && !defined(OFF64_T_MAX) +#define OFF64_T_MAX ((off64_t) ~(((uint64_t) 1) << (8 * sizeof(off64_t) - 1))) +#endif /* _LARGEFILE64_SOURCE && !OFF64_T_MAX */ + + +#endif /* MHD_LIMITS_H */ diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 3fb8d753..da8477e4 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -36,7 +36,7 @@ #include "response.h" #include "connection.h" #include "memorypool.h" -#include +#include "MHD_limits.h" #include "autoinit_funcs.h" #if HAVE_SEARCH_H @@ -117,10 +117,6 @@ #define EPOLL_CLOEXEC 0 #endif -#ifndef INT32_MAX -#define INT32_MAX ((int32_t)0x7FFFFFFF) -#endif /* !INT32_MAX */ - /** * Default implementation of the panic function, diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index cff5e5dc..a5ea15e0 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c @@ -28,7 +28,7 @@ #include "internal.h" #include "response.h" -#include +#include "MHD_limits.h" #if defined(_WIN32) && defined(MHD_W32_MUTEX_) #ifndef WIN32_LEAN_AND_MEAN @@ -305,10 +305,6 @@ MHD_set_response_options (struct MHD_Response *response, } -#ifndef INT32_MAX -#define INT32_MAX ((int32_t)0x7FFFFFFF) -#endif /* !INT32_MAX */ - /** * Given a file descriptor, read data from the file * to generate the response. diff --git a/w32/VS2013/libmicrohttpd.vcxproj b/w32/VS2013/libmicrohttpd.vcxproj index 827f9b35..08e1c7e1 100644 --- a/w32/VS2013/libmicrohttpd.vcxproj +++ b/w32/VS2013/libmicrohttpd.vcxproj @@ -92,6 +92,7 @@ + diff --git a/w32/VS2013/libmicrohttpd.vcxproj.filters b/w32/VS2013/libmicrohttpd.vcxproj.filters index cbe63801..4785328f 100644 --- a/w32/VS2013/libmicrohttpd.vcxproj.filters +++ b/w32/VS2013/libmicrohttpd.vcxproj.filters @@ -105,6 +105,9 @@ Header Files + + Source Files +