/**
 * =========================================================================
 * File        : posix_types.h
 * Project     : 0 A.D.
 * Description : lightweight header that defines POSIX types.
 * =========================================================================
 */

// license: GPL; see lib/license.txt

// this header defines e.g. ssize_t and int8_t without pulling in all
// POSIX declarations.
// included from lib/types.h in place of posix.h; this helps avoid conflicts
// due to incompatible winsock definitions.

#include <wchar.h>
#include <sys/types.h>
#include <stddef.h>
#include <limits.h>

#if OS_WIN
#include "lib/sysdep/win/wposix/wposix_types.h"
#else

// unix/linux/glibc/gcc says that this macro has to be defined when including
// stdint.h from C++ for stdint.h to define SIZE_MAX and friends
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include <stdint.h>

// but sometimes it still doesn't get defined, so define it ourselves
#ifndef SIZE_MAX
#define SIZE_MAX ((size_t)-1)
#endif

#include <unistd.h>

#endif  // #if !OS_WIN