1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 06:25:03 -05:00
curl/ares/setup.h

188 lines
5.1 KiB
C
Raw Normal View History

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