headers and types not present on Darwin either wrapped or added in linux_types.h

This commit is contained in:
Joshua Brindle 2016-04-21 21:31:44 -04:00
parent 9a89d9b63b
commit 42fb95a9c9
5 changed files with 32 additions and 4 deletions

View File

@ -11,3 +11,4 @@ include qhc/*
include tests/*.conf
include tests/*.py
include tests/perm_map
include include/*

18
include/linux_types.h Normal file
View File

@ -0,0 +1,18 @@
#ifndef linux_types_h
#define linux_types_h
#ifdef __linux__
# include "linux/types.h"
#else
# include <stdint.h>
typedef int32_t __s32;
typedef uint32_t __u32;
typedef uint8_t __u8;
typedef uint16_t __u16;
#define s6_addr32 __u6_addr32
#define IPPROTO_DCCP 33
#endif
#endif

View File

@ -28,8 +28,6 @@
#include "qpol_internal.h"
#include <assert.h>
#include <byteswap.h>
#include <endian.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
@ -37,7 +35,15 @@
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <asm/types.h>
#ifdef DARWIN
# include "linux_types.h"
# include <machine/endian.h>
# include <sys/types.h>
#else
# include <endian.h>
# include <asm/types.h>
#endif
#include <sepol/debug.h>
#include <sepol/handle.h>

View File

@ -57,6 +57,10 @@
#include <sepol/policydb/polcaps.h>
#include "queue.h"
#ifdef DARWIN
#include "linux_types.h"
#endif
/* Required for SETools libqpol - Removed #include "checkpolicy.h"*/
#include <qpol/policy.h>

View File

@ -46,7 +46,6 @@ const char *libqpol_get_version(void)
#include <stdlib.h>
#include <bzlib.h>
#include <string.h>
#include <sys/sendfile.h>
#define BZ2_MAGICSTR "BZh"
#define BZ2_MAGICLEN (sizeof(BZ2_MAGICSTR)-1)