1/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#pragma once
3
4#cmakedefine HAVE_NETINET_IN_H ${HAVE_NETINET_IN_H}
5#cmakedefine HAVE_ARPA_INET_H ${HAVE_ARPA_INET_H}
6#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
7#cmakedefine HAVE_UNISTD_H ${HAVE_UNISTD_H}
8#cmakedefine HAVE_FDATASYNC ${HAVE_FDATASYNC}
9#cmakedefine HAVE_QSORT_R ${HAVE_QSORT_R}
10
11/* Large File Support */
12#define _LARGE_FILE 1
13#ifndef _FILE_OFFSET_BITS
14#  define _FILE_OFFSET_BITS 64
15#elif (_FILE_OFFSET_BITS != 64)
16#error "bad things"
17#endif
18#define _LARGEFILE_SOURCE 1
19#ifndef O_LARGEFILE
20# define O_LARGEFILE 0
21#endif
22
23#include <sys/types.h>
24
25#ifdef HAVE_NETINET_IN_H
26#include <netinet/in.h>
27#endif
28
29#ifdef HAVE_ARPA_INET_H
30#include <arpa/inet.h>
31#endif
32
33#ifdef HAVE_INTTYPES_H
34#include <inttypes.h>
35#endif
36
37#ifdef HAVE_UNISTD_H
38#include <unistd.h>
39#endif
40
41#ifdef __APPLE__
42/* autoconf things OS X has fdatasync but it doesn't */
43#define fdatasync(FD) fsync(FD)
44#endif /* __APPLE__ */
45
46#include <platform/platform.h>
47
48#ifdef linux
49#undef ntohs
50#undef ntohl
51#undef htons
52#undef htonl
53#endif
54
55#if defined(WIN32) || defined(_WIN32)
56#define WINDOWS
57/* Mute:
58 * "The POSIX name for this item is deprecated. Instead, use the ISO
59 * C++ conformant name: _strdup."
60*/
61#pragma warning(disable: 4996)
62#define snprintf _snprintf
63#endif
64