Commit bcde0fc7 authored by Alejandro Mery's avatar Alejandro Mery
Browse files

move OSX compatible <endian.h> exception to a common "endian_compat.h" header

parent 329a13ed
......@@ -29,15 +29,7 @@
#include <stdio.h>
#include <errno.h>
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#define htole32(x) CFSwapInt32HostToLittle(x)
#define le32toh(x) CFSwapInt32LittleToHost(x)
#define htole16(x) CFSwapInt16HostToLittle(x)
#define le16toh(x) CFSwapInt16LittleToHost(x)
#else
#include <endian.h>
#endif
#include "endian_compat.h"
int errno;
......
#ifndef SUNXI_ENDIAN_COMPAT_H_
#define SUNXI_ENDIAN_COMPAT_H_
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
#define htole32(x) CFSwapInt32HostToLittle(x)
#define le32toh(x) CFSwapInt32LittleToHost(x)
#define htole16(x) CFSwapInt16HostToLittle(x)
#define le16toh(x) CFSwapInt16LittleToHost(x)
#else
#include <endian.h>
#endif
#endif
......@@ -21,9 +21,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <endian.h>
#include <unistd.h>
#include "endian_compat.h"
struct phoenix_ptable {
char signature[16]; /* "PHOENIX_CARD_IMG" */
unsigned int unknown1; /* 0x00200100 */
......
......@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <errno.h>
#include <endian.h>
#include "endian_compat.h"
#define PIO_REG_SIZE 0x228 /*0x300*/
#define PIO_PORT_SIZE 0x24
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment