Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Sunxi Tools
Commits
bcde0fc7
Commit
bcde0fc7
authored
Aug 07, 2012
by
Alejandro Mery
Browse files
move OSX compatible <endian.h> exception to a common "endian_compat.h" header
parent
329a13ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
fel.c
View file @
bcde0fc7
...
...
@@ -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
;
...
...
include/endian_compat.h
0 → 100644
View file @
bcde0fc7
#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
phoenix_info.c
View file @
bcde0fc7
...
...
@@ -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 */
...
...
pio.c
View file @
bcde0fc7
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment