1999e7ef5STrond Norbye/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
20c640a13STrond Norbye#pragma once
30c640a13STrond Norbye
40c640a13STrond Norbye#cmakedefine HAVE_NETINET_IN_H ${HAVE_NETINET_IN_H}
50c640a13STrond Norbye#cmakedefine HAVE_ARPA_INET_H ${HAVE_ARPA_INET_H}
60c640a13STrond Norbye#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
7462b7a82STrond Norbye#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
80c640a13STrond Norbye#cmakedefine HAVE_FDATASYNC ${HAVE_FDATASYNC}
923b42d51SSarath Lakshman#cmakedefine HAVE_QSORT_R ${HAVE_QSORT_R}
100c640a13STrond Norbye
11999e7ef5STrond Norbye/* Large File Support */
12999e7ef5STrond Norbye#define _LARGE_FILE 1
13999e7ef5STrond Norbye#ifndef _FILE_OFFSET_BITS
14999e7ef5STrond Norbye#  define _FILE_OFFSET_BITS 64
15999e7ef5STrond Norbye#elif (_FILE_OFFSET_BITS != 64)
16999e7ef5STrond Norbye#error "bad things"
17999e7ef5STrond Norbye#endif
18999e7ef5STrond Norbye#define _LARGEFILE_SOURCE 1
19999e7ef5STrond Norbye#ifndef O_LARGEFILE
20999e7ef5STrond Norbye# define O_LARGEFILE 0
21999e7ef5STrond Norbye#endif
22999e7ef5STrond Norbye
23999e7ef5STrond Norbye#include <sys/types.h>
24999e7ef5STrond Norbye
25999e7ef5STrond Norbye#ifdef HAVE_NETINET_IN_H
26999e7ef5STrond Norbye#include <netinet/in.h>
27999e7ef5STrond Norbye#endif
28999e7ef5STrond Norbye
29999e7ef5STrond Norbye#ifdef HAVE_ARPA_INET_H
30999e7ef5STrond Norbye#include <arpa/inet.h>
31999e7ef5STrond Norbye#endif
32999e7ef5STrond Norbye
33999e7ef5STrond Norbye#ifdef HAVE_INTTYPES_H
34999e7ef5STrond Norbye#include <inttypes.h>
35999e7ef5STrond Norbye#endif
36999e7ef5STrond Norbye
37999e7ef5STrond Norbye#ifdef HAVE_UNISTD_H
38999e7ef5STrond Norbye#include <unistd.h>
39999e7ef5STrond Norbye#endif
40999e7ef5STrond Norbye
41999e7ef5STrond Norbye#ifdef __APPLE__
42999e7ef5STrond Norbye/* autoconf things OS X has fdatasync but it doesn't */
43999e7ef5STrond Norbye#define fdatasync(FD) fsync(FD)
44999e7ef5STrond Norbye#endif /* __APPLE__ */
45999e7ef5STrond Norbye
46999e7ef5STrond Norbye#include <platform/platform.h>
47999e7ef5STrond Norbye
48999e7ef5STrond Norbye#ifdef linux
49999e7ef5STrond Norbye#undef ntohs
50999e7ef5STrond Norbye#undef ntohl
51999e7ef5STrond Norbye#undef htons
52999e7ef5STrond Norbye#undef htonl
53999e7ef5STrond Norbye#endif
54999e7ef5STrond Norbye
55999e7ef5STrond Norbye#if defined(WIN32) || defined(_WIN32)
56999e7ef5STrond Norbye#define WINDOWS
57999e7ef5STrond Norbye/* Mute:
58999e7ef5STrond Norbye * "The POSIX name for this item is deprecated. Instead, use the ISO
59999e7ef5STrond Norbye * C++ conformant name: _strdup."
60999e7ef5STrond Norbye*/
61999e7ef5STrond Norbye#pragma warning(disable: 4996)
62999e7ef5STrond Norbye#define snprintf _snprintf
63999e7ef5STrond Norbye#endif
64