|
Packit |
875988 |
/*
|
|
Packit |
875988 |
This file is part of libmicrohttpd
|
|
Packit |
875988 |
Copyright (C) 2016 Karlson2k (Evgeny Grin)
|
|
Packit |
875988 |
|
|
Packit |
875988 |
This library is free software; you can redistribute it and/or
|
|
Packit |
875988 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
875988 |
License as published by the Free Software Foundation; either
|
|
Packit |
875988 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
875988 |
|
|
Packit |
875988 |
This library is distributed in the hope that it will be useful,
|
|
Packit |
875988 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
875988 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
875988 |
Lesser General Public License for more details.
|
|
Packit |
875988 |
|
|
Packit |
875988 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
875988 |
License along with this library; if not, write to the Free Software
|
|
Packit |
875988 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* @file include/mhd_options.h
|
|
Packit |
875988 |
* @brief additional automatic macros for MHD_config.h
|
|
Packit |
875988 |
* @author Karlson2k (Evgeny Grin)
|
|
Packit |
875988 |
*
|
|
Packit |
875988 |
* This file includes MHD_config.h and adds automatic macros based on values
|
|
Packit |
875988 |
* in MHD_config.h, compiler built-in macros and commandline-defined macros
|
|
Packit |
875988 |
* (but not based on values defined in other headers). Works also as a guard
|
|
Packit |
875988 |
* to prevent double inclusion of MHD_config.h
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef MHD_OPTIONS_H
|
|
Packit |
875988 |
#define MHD_OPTIONS_H 1
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#include "MHD_config.h"
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/**
|
|
Packit |
875988 |
* Macro to make it easy to mark text for translation. Note that
|
|
Packit |
875988 |
* we do not actually call gettext() in MHD, but we do make it
|
|
Packit |
875988 |
* easy to create a ".po" file so that applications that do want
|
|
Packit |
875988 |
* to translate error messages can do so.
|
|
Packit |
875988 |
*/
|
|
Packit |
875988 |
#define _(String) (String)
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifndef _MHD_EXTERN
|
|
Packit |
875988 |
#if defined(BUILDING_MHD_LIB) && defined(_WIN32) && \
|
|
Packit |
875988 |
(defined(DLL_EXPORT) || defined(MHD_W32DLL))
|
|
Packit |
875988 |
#define _MHD_EXTERN __declspec(dllexport) extern
|
|
Packit |
875988 |
#else /* !BUILDING_MHD_LIB || !_WIN32 || (!DLL_EXPORT && !MHD_W32DLL) */
|
|
Packit |
875988 |
#define _MHD_EXTERN extern
|
|
Packit |
875988 |
#endif /* !BUILDING_MHD_LIB || !_WIN32 || (!DLL_EXPORT && !MHD_W32DLL) */
|
|
Packit |
875988 |
#endif /* ! _MHD_EXTERN */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Some platforms (FreeBSD, Solaris, W32) allow to override
|
|
Packit |
875988 |
default FD_SETSIZE by defining it before including
|
|
Packit |
875988 |
headers. */
|
|
Packit |
875988 |
#ifdef FD_SETSIZE
|
|
Packit |
875988 |
/* FD_SETSIZE defined in command line or in MHD_config.h */
|
|
Packit |
875988 |
#elif defined(_WIN32) || defined(__CYGWIN__)
|
|
Packit |
875988 |
/* Platform with WinSock and without overridden FD_SETSIZE */
|
|
Packit |
875988 |
#define FD_SETSIZE 2048 /* Override default small value (64) */
|
|
Packit |
875988 |
#else /* !FD_SETSIZE && !W32 */
|
|
Packit |
875988 |
/* System default value of FD_SETSIZE is used */
|
|
Packit |
875988 |
#define _MHD_FD_SETSIZE_IS_DEFAULT 1
|
|
Packit |
875988 |
#endif /* !FD_SETSIZE && !W32 */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if defined(HAVE_LINUX_SENDFILE) || defined(HAVE_FREEBSD_SENDFILE) || \
|
|
Packit |
875988 |
defined(HAVE_DARWIN_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE)
|
|
Packit |
875988 |
/* Have any supported sendfile() function. */
|
|
Packit |
875988 |
#define _MHD_HAVE_SENDFILE
|
|
Packit |
875988 |
#endif /* HAVE_LINUX_SENDFILE || HAVE_FREEBSD_SENDFILE ||
|
|
Packit |
875988 |
HAVE_DARWIN_SENDFILE || HAVE_SOLARIS_SENDFILE */
|
|
Packit |
875988 |
#if defined(HAVE_LINUX_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE)
|
|
Packit |
875988 |
#define MHD_LINUX_SOLARIS_SENDFILE 1
|
|
Packit |
875988 |
#endif /* HAVE_LINUX_SENDFILE || HAVE_SOLARIS_SENDFILE */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if OS390
|
|
Packit |
875988 |
#define _OPEN_THREADS
|
|
Packit |
875988 |
#define _OPEN_SYS_SOCK_IPV6
|
|
Packit |
875988 |
#define _OPEN_MSGQ_EXT
|
|
Packit |
875988 |
#define _LP64
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if defined(_WIN32) && ! defined(__CYGWIN__)
|
|
Packit |
875988 |
#ifndef _WIN32_WINNT
|
|
Packit |
875988 |
#define _WIN32_WINNT 0x0501
|
|
Packit |
875988 |
#else /* _WIN32_WINNT */
|
|
Packit |
875988 |
#if _WIN32_WINNT < 0x0501
|
|
Packit |
875988 |
#error "Headers for Windows XP or later are required"
|
|
Packit |
875988 |
#endif /* _WIN32_WINNT < 0x0501 */
|
|
Packit |
875988 |
#endif /* _WIN32_WINNT */
|
|
Packit |
875988 |
#ifndef WIN32_LEAN_AND_MEAN
|
|
Packit |
875988 |
/* Do not include unneeded parts of W32 headers. */
|
|
Packit |
875988 |
#define WIN32_LEAN_AND_MEAN 1
|
|
Packit |
875988 |
#endif /* !WIN32_LEAN_AND_MEAN */
|
|
Packit |
875988 |
#endif /* _WIN32 && ! __CYGWIN__ */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS)
|
|
Packit |
875988 |
#define RESTRICT __restrict__
|
|
Packit |
875988 |
#endif /* __VXWORKS__ || __vxworks || OS_VXWORKS */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if LINUX+0 && (defined(HAVE_SENDFILE64) || defined(HAVE_LSEEK64)) && ! defined(_LARGEFILE64_SOURCE)
|
|
Packit |
875988 |
/* On Linux, special macro is required to enable definitions of some xxx64 functions */
|
|
Packit |
875988 |
#define _LARGEFILE64_SOURCE 1
|
|
Packit |
875988 |
#endif
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#ifdef HAVE_C11_GMTIME_S
|
|
Packit |
875988 |
/* Special macro is required to enable C11 definition of gmtime_s() function */
|
|
Packit |
875988 |
#define __STDC_WANT_LIB_EXT1__ 1
|
|
Packit |
875988 |
#endif /* HAVE_C11_GMTIME_S */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if defined(MHD_FAVOR_FAST_CODE) && defined(MHD_FAVOR_SMALL_CODE)
|
|
Packit |
875988 |
#error MHD_FAVOR_FAST_CODE and MHD_FAVOR_SMALL_CODE are both defined. Cannot favor speed and size at the same time.
|
|
Packit |
875988 |
#endif /* MHD_FAVOR_FAST_CODE && MHD_FAVOR_SMALL_CODE */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
/* Define MHD_FAVOR_FAST_CODE to force fast code path or
|
|
Packit |
875988 |
define MHD_FAVOR_SMALL_CODE to choose compact code path */
|
|
Packit |
875988 |
#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE)
|
|
Packit |
875988 |
/* Try to detect user preferences */
|
|
Packit |
875988 |
/* Defined by GCC and many compatible compilers */
|
|
Packit |
875988 |
#if defined(__OPTIMIZE_SIZE__)
|
|
Packit |
875988 |
#define MHD_FAVOR_SMALL_CODE 1
|
|
Packit |
875988 |
#elif defined(__OPTIMIZE__)
|
|
Packit |
875988 |
#define MHD_FAVOR_FAST_CODE 1
|
|
Packit |
875988 |
#endif /* __OPTIMIZE__ */
|
|
Packit |
875988 |
#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#if !defined(MHD_FAVOR_FAST_CODE) && !defined(MHD_FAVOR_SMALL_CODE)
|
|
Packit |
875988 |
/* Use faster code by default */
|
|
Packit |
875988 |
#define MHD_FAVOR_FAST_CODE 1
|
|
Packit |
875988 |
#endif /* !MHD_FAVOR_FAST_CODE && !MHD_FAVOR_SMALL_CODE */
|
|
Packit |
875988 |
|
|
Packit |
875988 |
#endif /* MHD_OPTIONS_H */
|