tighten up compat include paths, fix glibc compatibility

This commit is contained in:
Brent Cook 2015-07-21 12:04:07 -06:00
parent 5d8a1cf715
commit cbdc8ca820
4 changed files with 10 additions and 16 deletions

View File

@ -3,18 +3,16 @@
* Public domain
*/
#ifndef LIBCRYPTOCOMPAT_STDLIB_H
#define LIBCRYPTOCOMPAT_STDLIB_H
#ifdef _MSC_VER
#include <../include/stdlib.h>
#else
#include_next <stdlib.h>
#endif
#ifndef LIBCRYPTOCOMPAT_STDLIB_H
#define LIBCRYPTOCOMPAT_STDLIB_H
#include <sys/types.h>
#include <sys/stat.h>
//#include <sys/time.h>
#include <stdint.h>
#ifndef HAVE_ARC4RANDOM_BUF

View File

@ -6,7 +6,10 @@
#ifndef LIBCRYPTOCOMPAT_SYS_STAT_H
#define LIBCRYPTOCOMPAT_SYS_STAT_H
#ifdef _MSC_VER
#ifndef _MSC_VER
#include_next <sys/stat.h>
#else
#include <windows.h>
#include <../include/sys/stat.h>
@ -88,8 +91,6 @@
#define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
#define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
#else
#include_next <sys/stat.h>
#endif
#endif

View File

@ -3,15 +3,15 @@
* sys/types.h compatibility shim
*/
#ifndef LIBCRYPTOCOMPAT_SYS_TYPES_H
#define LIBCRYPTOCOMPAT_SYS_TYPES_H
#ifdef _MSC_VER
#include <../include/sys/types.h>
#else
#include_next <sys/types.h>
#endif
#ifndef LIBCRYPTOCOMPAT_SYS_TYPES_H
#define LIBCRYPTOCOMPAT_SYS_TYPES_H
#include <stdint.h>
#ifdef __MINGW32__

View File

@ -3,14 +3,9 @@
* sys/time.h compatibility shim
*/
#ifndef LIBCRYPTOCOMPAT_TIME_H
#define LIBCRYPTOCOMPAT_TIME_H
#ifdef _MSC_VER
#include <../include/time.h>
#define gmtime_r(tp, tm) ((gmtime_s((tm), (tp)) == 0) ? (tm) : NULL)
#else
#include_next <time.h>
#endif
#endif