mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
prefer socket.h over other variants (winsock etc.)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
/*! \file
|
/*! \file
|
||||||
* \brief Wrapper for network related headers,
|
* \brief Wrapper for network related headers,
|
||||||
* masking differences between various operating systems.
|
* masking differences between various operating systems.
|
||||||
|
* On passing, we also provide here trivial functions or
|
||||||
|
* other simple wrappers to network-related functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _ASTERISK_NETWORK_H
|
#ifndef _ASTERISK_NETWORK_H
|
||||||
@@ -28,14 +30,14 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_WINSOCK2_H_NOT
|
/*
|
||||||
#include <winsock2.h>
|
* Include relevant network headers.
|
||||||
#include <ws2tcpip.h>
|
* Our preferred choice are the standard BSD/linux/unix headers.
|
||||||
#elif defined(HAVE_WINSOCK_H)
|
* Missing them (e.g. for solaris or various windows environments),
|
||||||
#include <winsock.h>
|
* we resort to whatever we find around, and provide local definitions
|
||||||
typedef int socklen_t;
|
* for the missing bits.
|
||||||
|
*/
|
||||||
#else
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h> /* include early to override inet_ntoa */
|
#include <arpa/inet.h> /* include early to override inet_ntoa */
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/in_systm.h>
|
#include <netinet/in_systm.h>
|
||||||
@@ -43,6 +45,14 @@ typedef int socklen_t;
|
|||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#elif defined(HAVE_WINSOCK_H)
|
||||||
|
#include <winsock.h>
|
||||||
|
typedef int socklen_t;
|
||||||
|
#elif defined(HAVE_WINSOCK2_H)
|
||||||
|
#include <winsock2.h>
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#else
|
||||||
|
#error don't know how to handle network functions here.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_INET_ATON
|
#ifndef HAVE_INET_ATON
|
||||||
|
Reference in New Issue
Block a user