#ifndef CONFIG_H
#define CONFIG_H

// portability mapper
#include <limits.h>

// force debug support
#define NE_DEBUGGING

// force dav
#define NE_HAVE_DAV 1

// Force TLS and thread safety callback once forever
#define HAVE_CRYPTO_SET_IDPTR_CALLBACK
#define NE_HAVE_TS_SSL

//has malloc
#cmakedefine HAVE_MALLOC_H 1

// has errno
#cmakedefine HAVE_ERRNO_H 1

// has stdlib
#cmakedefine HAVE_STDLIB_H 1

// has fcntl
#cmakedefine HAVE_FCNTL_H 1

// string and strings
#cmakedefine  HAVE_STRING_H 1
#cmakedefine  HAVE_STRINGS_H 1

// has unistd
#cmakedefine HAVE_UNISTD_H 1

// has I18N
#cmakedefine NE_HAVE_I18N 1

// ipv6 support
#cmakedefine HAVE_IPV6 1

// tcp no delay
#cmakedefine TCP_NODELAY 1

// has system select
#cmakedefine HAVE_SYS_SELECT_H 1

// has system socket
#cmakedefine HAVE_SYS_SOCKET_H 1

// has system time
#cmakedefine HAVE_SYS_TIME_H 1

// has system uio
#cmakedefine HAVE_SYS_UIO_H 1

// has setsockopt
#cmakedefine HAVE_SETSOCKOPT 1

// has signal support
#cmakedefine HAVE_SIGNAL_H 1

#ifdef HAVE_SIGNAL_H
#define HAVE_SIGNAL
#endif

// has getaddrinfo
#cmakedefine HAVE_GETADDRINFO_H 1
#ifdef HAVE_GETADDRINFO_H
#define USE_GETADDRINFO 1
#endif

// has locale
#cmakedefine HAVE_LOCALE_H 1

// general SSL support
#cmakedefine NE_HAVE_SSL 1

// openssl support
#cmakedefine HAVE_OPENSSL 1

//gnutls support
#cmakedefine HAVE_GNUTLS 1

// libxml support
#cmakedefine HAVE_LIBXML 1

// libexpat support
#cmakedefine HAVE_EXPAT 1

// has strptime
#cmakedefine HAVE_STRPTIME_H 1
#ifndef HAVE_STRPTIME_H
#	define strptime __strptime
#endif

// has mempcpy
//#cmakedefine HAVE_MEMPCPY_H 1
//#include <mempcpy/mempcpy.h>

#cmakedefine HAVE_STRLCPY_H 1

// poll
#cmakedefine HAVE_SYS_POLL_H 1
#ifdef HAVE_SYS_POLL_H
#define NE_USE_POLL
#endif

//net
#cmakedefine HAVE_NETINET_IN_H 1
#cmakedefine HAVE_NETINET_TCP_H 1
#cmakedefine HAVE_ARPA_INET_H 1
#cmakedefine HAVE_NETDB_H 1

// in_add_t
#cmakedefine HAVE_IN_ADDR_T 1
#ifndef HAVE_IN_ADDR_T
#define in_addr_t unsigned int
#endif

// socklen_t
#cmakedefine HAVE_SOCKLEN_T 1
#ifndef HAVE_SOCKLEN_T
#define socklen_t int
#endif

// type size
#define SIZEOF_INT @DEF_SIZEOF_INT@
#define SIZEOF_LONG @DEF_SIZEOF_LONG@
#define SIZEOF_SIZE_T @DEF_SIZEOF_SIZE_T@
#define SIZEOF_SSIZE_T @DEF_SIZEOF_SSIZE_T@
#define SIZEOF_OFF_T @DEF_SIZEOF_OFF_T@

#if( SIZEOF_INT == SIZEOF_SIZE_T )
#   define NE_FMT_SIZE_T "d"
#else
#   define NE_FMT_SIZE_T "ld"
#endif

#if( SIZEOF_INT == SIZEOF_SSIZE_T )
#   define NE_FMT_SSIZE_T "d"
#else
#   define NE_FMT_SSIZE_T "ld"
#endif

#if( SIZEOF_INT == SIZEOF_OFF_T )
#   define NE_FMT_OFF_T "d"
#elif( SIZEOF_LONG == SIZEOF_OFF_T )
#   define NE_FMT_OFF_T "ld"
#else
#   define NE_FMT_OFF_T "lld"
#endif


//
// Win 32 mapper
#if( defined _WIN32 )|| ( defined __MINGW32__ )
// macros

#define __PLATFORM_WINDOWS__

// windows headers
#include <Windows.h>
#include <Winnls.h>
#endif /* end of win32*/



#endif // CONFIG_H
