/* This file is part of libmicrohttpd Copyright (C) 2008 Christian Grothoff (and other contributing authors) 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 platform.h * @brief platform-specific includes for libmicrohttpd * @author Christian Grothoff * * This file is included by the libmicrohttpd code * before "microhttpd.h"; it provides the required * standard headers (which are platform-specific).
*
* Note that this file depends on our configure.ac
* build process and the generated config.h file.
* Hence you cannot include it directly in applications
* that use libmicrohttpd.
*/
#ifndef MHD_PLATFORM_H
#define MHD_PLATFORM_H
#ifndef HAVE_USED_MHD_CONFIG_H
#define HAVE_USED_MHD_CONFIG_H
#include "MHD_config.h"
#endif
#ifndef BUILDING_MHD_LIB
#ifdef _MHD_EXTERN
#undef _MHD_EXTERN
#endif /* _MHD_EXTERN */
#if defined(_WIN32) && defined(MHD_W32LIB)
#define _MHD_EXTERN extern
#elif defined (_WIN32) && defined(MHD_W32DLL)
#define _MHD_EXTERN __declspec(dllimport)
#else
#define _MHD_EXTERN extern
#endif
#elif !defined(_MHD_EXTERN) /* && BUILDING_MHD_LIB */
#if defined(_WIN32) && defined(MHD_W32LIB)
#define _MHD_EXTERN extern
#elif defined (_WIN32) && defined(MHD_W32DLL)
#define _MHD_EXTERN extern __declspec(dllexport)
#else
#define _MHD_EXTERN extern
#endif
#endif /* BUILDING_MHD_LIB */
#ifdef FD_SETSIZE
/* FD_SETSIZE defined in command line or in MHD_config.h */
/* Some platforms (FreeBSD, Solaris, W32) allow to override
default FD_SETSIZE by defining it before including
headers. */
#define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value()
#elif defined(_WIN32) && !defined(__CYGWIN__)
/* Platform with WinSock and without overridden FD_SETSIZE */
#define FD_SETSIZE 2048 /* Override default small value */
#define _MHD_SYS_DEFAULT_FD_SETSIZE get_system_fdsetsize_value()
#else /* !FD_SETSIZE && !WinSock*/
#define _MHD_SYS_DEFAULT_FD_SETSIZE FD_SETSIZE
#define _MHD_FD_SETSIZE_IS_DEFAULT 1
#endif /* FD_SETSIZE */
#define _XOPEN_SOURCE_EXTENDED 1
#if OS390
#define _OPEN_THREADS
#define _OPEN_SYS_SOCK_IPV6
#define _OPEN_MSGQ_EXT
#define _LP64
#endif
#if defined(_WIN32)
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501
#else /* _WIN32_WINNT */
#if _WIN32_WINNT < 0x0501
#error "Headers for Windows XP or later are required"
#endif /* _WIN32_WINNT < 0x0501 */
#endif /* _WIN32_WINNT */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif /* !WIN32_LEAN_AND_MEAN */
#endif /* _WIN32 */
#if LINUX+0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && ! defined(_LARGEFILE64_SOURCE)
#define _LARGEFILE64_SOURCE 1
#endif
#ifdef HAVE_C11_GMTIME_S
#define __STDC_WANT_LIB_EXT1__ 1
#endif /* HAVE_C11_GMTIME_S */
#include