jcs's openbsd hax
openbsd
at jcs 71 lines 1.6 kB view raw
1/* 2 * stdinc.h 3 * pull in standard headers (including portability hacks) 4 * 5 * Copyright (c) 2012 pkgconf authors (see AUTHORS). 6 * 7 * Permission to use, copy, modify, and/or distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * This software is provided 'as is' and without any warranty, express or 12 * implied. In no event shall the authors be liable for any damages arising 13 * from the use of this software. 14 */ 15 16#ifndef LIBPKGCONF_STDINC_H 17#define LIBPKGCONF_STDINC_H 18 19#include <ctype.h> 20#include <stdio.h> 21#include <stdlib.h> 22#include <stddef.h> 23#include <stdbool.h> 24#include <stdarg.h> 25#include <string.h> 26#include <sys/types.h> 27#include <stdint.h> 28#include <errno.h> 29 30#ifdef _WIN32 31# define WIN32_LEAN_AND_MEAN 32# include <windows.h> 33# include <malloc.h> 34# define PATH_DEV_NULL "nul" 35# ifdef _WIN64 36# define SIZE_FMT_SPECIFIER "%I64u" 37# else 38# define SIZE_FMT_SPECIFIER "%u" 39# endif 40# ifndef ssize_t 41# ifndef __MINGW32__ 42# include <BaseTsd.h> 43# else 44# include <basetsd.h> 45# endif 46# define ssize_t SSIZE_T 47# endif 48# ifndef __MINGW32__ 49# include "win-dirent.h" 50# else 51# include <dirent.h> 52# endif 53# define PKGCONF_ITEM_SIZE (_MAX_PATH + 1024) 54#else 55# define PATH_DEV_NULL "/dev/null" 56# define SIZE_FMT_SPECIFIER "%zu" 57# ifdef __HAIKU__ 58# include <FindDirectory.h> 59# endif 60# include <dirent.h> 61# include <unistd.h> 62# include <limits.h> 63# include <strings.h> 64# ifdef PATH_MAX 65# define PKGCONF_ITEM_SIZE (PATH_MAX + 1024) 66# else 67# define PKGCONF_ITEM_SIZE (4096 + 1024) 68# endif 69#endif 70 71#endif