libsepol,checkpolicy,secilc: Replace #ifdef DARWIN with __APPLE__.

As per discussion in https://android-review.googlesource.com/#/c/221980,
we should be using #ifdef __APPLE__ rather than our own custom-defined
DARWIN for building on MacOS X.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
Stephen Smalley 2016-05-03 11:54:20 -04:00
parent 6ad28de149
commit bedef7d124
9 changed files with 10 additions and 22 deletions

View File

@ -12,10 +12,6 @@ common_cflags := \
-Wall -Wshadow -O2 \
-pipe -fno-strict-aliasing \
ifeq ($(HOST_OS),darwin)
common_cflags += -DDARWIN
endif
common_includes := \
$(LOCAL_PATH)/ \
$(LOCAL_PATH)/../libsepol/include/ \

View File

@ -73,7 +73,7 @@
#include <errno.h>
#include <sys/mman.h>
#ifdef DARWIN
#ifdef __APPLE__
#include <ctype.h>
#endif

View File

@ -5140,7 +5140,7 @@ int define_ipv6_node_context(void)
memset(newc, 0, sizeof(ocontext_t));
#ifdef DARWIN
#ifdef __APPLE__
memcpy(&newc->u.node6.addr[0], &addr.s6_addr[0], 16);
memcpy(&newc->u.node6.mask[0], &mask.s6_addr[0], 16);
#else

View File

@ -69,10 +69,6 @@ common_cflags := \
-Wshadow -Wmissing-noreturn \
-Wmissing-format-attribute
ifeq ($(HOST_OS), darwin)
common_cflags += -DDARWIN
endif
common_includes := \
$(LOCAL_PATH)/include/ \
$(LOCAL_PATH)/src/ \

View File

@ -79,7 +79,7 @@ static int load_booleans(struct policydb *policydb, const char *path,
if (boolf == NULL)
goto localbool;
#ifdef DARWIN
#ifdef __APPLE__
if ((buffer = (char *)malloc(255 * sizeof(char))) == NULL) {
ERR(NULL, "out of memory");
return -1;
@ -111,7 +111,7 @@ static int load_booleans(struct policydb *policydb, const char *path,
boolf = fopen(localbools, "r");
if (boolf != NULL) {
#ifdef DARWIN
#ifdef __APPLE__
while(fgets(buffer, 255, boolf) != NULL) {
#else

View File

@ -7,7 +7,7 @@
#include <sepol/policydb/policydb.h>
#ifndef DARWIN
#ifndef __APPLE__
#include <stdio_ext.h>
#endif
@ -47,7 +47,7 @@ static int load_users(struct policydb *policydb, const char *path)
if (fp == NULL)
return -1;
#ifdef DARWIN
#ifdef __APPLE__
if ((buffer = (char *)malloc(255 * sizeof(char))) == NULL) {
ERR(NULL, "out of memory");
return -1;

View File

@ -70,7 +70,7 @@ static int node_parse_addr(sepol_handle_t * handle,
return STATUS_ERR;
}
#ifdef DARWIN
#ifdef __APPLE__
memcpy(addr_bytes, in_addr.s6_addr, 16);
#else
memcpy(addr_bytes, in_addr.s6_addr32, 16);
@ -162,7 +162,7 @@ static int node_expand_addr(sepol_handle_t * handle,
{
struct in6_addr addr;
memset(&addr, 0, sizeof(struct in6_addr));
#ifdef DARWIN
#ifdef __APPLE__
memcpy(&addr.s6_addr[0], addr_bytes, 16);
#else
memcpy(&addr.s6_addr32[0], addr_bytes, 16);

View File

@ -5,7 +5,7 @@
#include <sepol/policydb/policydb.h>
#ifdef DARWIN
#ifdef __APPLE__
#include <sys/types.h>
#include <machine/endian.h>
#else
@ -16,7 +16,7 @@
#include <errno.h>
#include <dso.h>
#ifdef DARWIN
#ifdef __APPLE__
#define __BYTE_ORDER BYTE_ORDER
#define __LITTLE_ENDIAN LITTLE_ENDIAN
#endif

View File

@ -6,10 +6,6 @@ common_cflags := \
-Wall -Wshadow -O2 \
-pipe -fno-strict-aliasing \
ifeq ($(HOST_OS), darwin)
common_cflags += -DDARWIN
endif
common_includes := \
$(LOCAL_PATH)/../libsepol/cil/include/ \
$(LOCAL_PATH)/../libsepol/include/ \