Blame ares_setup.h

Packit 514978
#ifndef HEADER_CARES_SETUP_H
Packit 514978
#define HEADER_CARES_SETUP_H
Packit 514978
Packit 514978
Packit 514978
/* Copyright (C) 2004 - 2012 by Daniel Stenberg et al
Packit 514978
 *
Packit 514978
 * Permission to use, copy, modify, and distribute this software and its
Packit 514978
 * documentation for any purpose and without fee is hereby granted, provided
Packit 514978
 * that the above copyright notice appear in all copies and that both that
Packit 514978
 * copyright notice and this permission notice appear in supporting
Packit 514978
 * documentation, and that the name of M.I.T. not be used in advertising or
Packit 514978
 * publicity pertaining to distribution of the software without specific,
Packit 514978
 * written prior permission.  M.I.T. makes no representations about the
Packit 514978
 * suitability of this software for any purpose.  It is provided "as is"
Packit 514978
 * without express or implied warranty.
Packit 514978
 */
Packit 514978
Packit 514978
/*
Packit 514978
 * Define WIN32 when build target is Win32 API
Packit 514978
 */
Packit 514978
Packit 514978
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
Packit 514978
#define WIN32
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Include configuration script results or hand-crafted
Packit 514978
 * configuration file for platforms which lack config tool.
Packit 514978
 */
Packit 514978
Packit 514978
#ifdef HAVE_CONFIG_H
Packit 514978
#include "ares_config.h"
Packit 514978
#else
Packit 514978
Packit 514978
#ifdef WIN32
Packit 514978
#include "config-win32.h"
Packit 514978
#endif
Packit 514978
Packit 514978
#endif /* HAVE_CONFIG_H */
Packit 514978
Packit 514978
/* ================================================================ */
Packit 514978
/* Definition of preprocessor macros/symbols which modify compiler  */
Packit 514978
/* behaviour or generated code characteristics must be done here,   */
Packit 514978
/* as appropriate, before any system header file is included. It is */
Packit 514978
/* also possible to have them defined in the config file included   */
Packit 514978
/* before this point. As a result of all this we frown inclusion of */
Packit 514978
/* system header files in our config files, avoid this at any cost. */
Packit 514978
/* ================================================================ */
Packit 514978
Packit 514978
/*
Packit 514978
 * AIX 4.3 and newer needs _THREAD_SAFE defined to build
Packit 514978
 * proper reentrant code. Others may also need it.
Packit 514978
 */
Packit 514978
Packit 514978
#ifdef NEED_THREAD_SAFE
Packit 514978
#  ifndef _THREAD_SAFE
Packit 514978
#    define _THREAD_SAFE
Packit 514978
#  endif
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Tru64 needs _REENTRANT set for a few function prototypes and
Packit 514978
 * things to appear in the system header files. Unixware needs it
Packit 514978
 * to build proper reentrant code. Others may also need it.
Packit 514978
 */
Packit 514978
Packit 514978
#ifdef NEED_REENTRANT
Packit 514978
#  ifndef _REENTRANT
Packit 514978
#    define _REENTRANT
Packit 514978
#  endif
Packit 514978
#endif
Packit 514978
Packit 514978
/* ================================================================ */
Packit 514978
/*  If you need to include a system header file for your platform,  */
Packit 514978
/*  please, do it beyond the point further indicated in this file.  */
Packit 514978
/* ================================================================ */
Packit 514978
Packit 514978
/*
Packit 514978
 * c-ares external interface definitions are also used internally,
Packit 514978
 * and might also include required system header files to define them.
Packit 514978
 */
Packit 514978
Packit 514978
#include <ares_build.h>
Packit 514978
Packit 514978
/*
Packit 514978
 * Compile time sanity checks must also be done when building the library.
Packit 514978
 */
Packit 514978
Packit 514978
#include <ares_rules.h>
Packit 514978
Packit 514978
/* ================================================================= */
Packit 514978
/* No system header file shall be included in this file before this  */
Packit 514978
/* point. The only allowed ones are those included from ares_build.h */
Packit 514978
/* ================================================================= */
Packit 514978
Packit 514978
/*
Packit 514978
 * Include header files for windows builds before redefining anything.
Packit 514978
 * Use this preproessor block only to include or exclude windows.h,
Packit 514978
 * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
Packit 514978
 * to any other further and independent block.  Under Cygwin things work
Packit 514978
 * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
Packit 514978
 * never be included when __CYGWIN__ is defined.  configure script takes
Packit 514978
 * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
Packit 514978
 * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
Packit 514978
 */
Packit 514978
Packit 514978
#ifdef HAVE_WINDOWS_H
Packit 514978
#  ifndef WIN32_LEAN_AND_MEAN
Packit 514978
#    define WIN32_LEAN_AND_MEAN
Packit 514978
#  endif
Packit 514978
#  include <windows.h>
Packit 514978
#  ifdef HAVE_WINSOCK2_H
Packit 514978
#    include <winsock2.h>
Packit 514978
#    ifdef HAVE_WS2TCPIP_H
Packit 514978
#       include <ws2tcpip.h>
Packit 514978
#    endif
Packit 514978
#  else
Packit 514978
#    ifdef HAVE_WINSOCK_H
Packit 514978
#      include <winsock.h>
Packit 514978
#    endif
Packit 514978
#  endif
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
Packit 514978
 * define USE_WINSOCK to 1 if we have and use WINSOCK  API, else
Packit 514978
 * undefine USE_WINSOCK.
Packit 514978
 */
Packit 514978
Packit 514978
#undef USE_WINSOCK
Packit 514978
Packit 514978
#ifdef HAVE_WINSOCK2_H
Packit 514978
#  define USE_WINSOCK 2
Packit 514978
#else
Packit 514978
#  ifdef HAVE_WINSOCK_H
Packit 514978
#    define USE_WINSOCK 1
Packit 514978
#  endif
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Work-arounds for systems without configure support
Packit 514978
 */
Packit 514978
Packit 514978
#ifndef HAVE_CONFIG_H
Packit 514978
Packit 514978
#if !defined(HAVE_SYS_TIME_H) && !defined(_MSC_VER) && !defined(__WATCOMC__)
Packit 514978
#define HAVE_SYS_TIME_H
Packit 514978
#endif
Packit 514978
Packit 514978
#if !defined(HAVE_UNISTD_H) && !defined(_MSC_VER)
Packit 514978
#define HAVE_UNISTD_H 1
Packit 514978
#endif
Packit 514978
Packit 514978
#if !defined(HAVE_SYS_UIO_H) && !defined(WIN32) && !defined(MSDOS)
Packit 514978
#define HAVE_SYS_UIO_H
Packit 514978
#endif
Packit 514978
Packit 514978
#endif /* HAVE_CONFIG_H */
Packit 514978
Packit 514978
/*
Packit 514978
 * Arg 2 type for gethostname in case it hasn't been defined in config file.
Packit 514978
 */
Packit 514978
Packit 514978
#ifndef GETHOSTNAME_TYPE_ARG2
Packit 514978
#  ifdef USE_WINSOCK
Packit 514978
#    define GETHOSTNAME_TYPE_ARG2 int
Packit 514978
#  else
Packit 514978
#    define GETHOSTNAME_TYPE_ARG2 size_t
Packit 514978
#  endif
Packit 514978
#endif
Packit 514978
Packit 514978
#ifdef __POCC__
Packit 514978
#  include <sys/types.h>
Packit 514978
#  include <unistd.h>
Packit 514978
#  define ESRCH 3
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Android does have the arpa/nameser.h header which is detected by configure
Packit 514978
 * but it appears to be empty with recent NDK r7b / r7c, so we undefine here.
Packit 514978
 */
Packit 514978
#if (defined(ANDROID) || defined(__ANDROID__)) && defined(HAVE_ARPA_NAMESER_H)
Packit 514978
#  undef HAVE_ARPA_NAMESER_H
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Recent autoconf versions define these symbols in ares_config.h. We don't
Packit 514978
 * want them (since they collide with the libcurl ones when we build
Packit 514978
 *  --enable-debug) so we undef them again here.
Packit 514978
 */
Packit 514978
Packit 514978
#undef PACKAGE_STRING
Packit 514978
#undef PACKAGE_TARNAME
Packit 514978
#undef PACKAGE_VERSION
Packit 514978
#undef PACKAGE_BUGREPORT
Packit 514978
#undef PACKAGE_NAME
Packit 514978
#undef VERSION
Packit 514978
#undef PACKAGE
Packit 514978
Packit 514978
/* IPv6 compatibility */
Packit 514978
#if !defined(HAVE_AF_INET6)
Packit 514978
#if defined(HAVE_PF_INET6)
Packit 514978
#define AF_INET6 PF_INET6
Packit 514978
#else
Packit 514978
#define AF_INET6 AF_MAX+1
Packit 514978
#endif
Packit 514978
#endif
Packit 514978
Packit 514978
/*
Packit 514978
 * Include macros and defines that should only be processed once.
Packit 514978
 */
Packit 514978
Packit 514978
#ifndef __SETUP_ONCE_H
Packit 514978
#include "setup_once.h"
Packit 514978
#endif
Packit 514978
Packit 514978
#endif /* HEADER_CARES_SETUP_H */