mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-23 09:56:37 +08:00
move OSX compatible <endian.h> exception to a common "endian_compat.h" header
This commit is contained in:
parent
329a13ed75
commit
bcde0fc721
10
fel.c
10
fel.c
@ -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;
|
||||
|
||||
|
14
include/endian_compat.h
Normal file
14
include/endian_compat.h
Normal file
@ -0,0 +1,14 @@
|
||||
#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 */
|
||||
|
Loading…
Reference in New Issue
Block a user