Skip to content

Commit

Permalink
Merge pull request #56 from bettse/macos_endianess_fixes
Browse files Browse the repository at this point in the history
Macos endianess fixes
  • Loading branch information
smortex committed Apr 4, 2017
2 parents 295104a + 358df77 commit b131f74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions examples/felica-read-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@
# include <endian.h>
#endif

#if defined(HAVE_COREFOUNDATION_COREFOUNDATION_H)
# include <CoreFoundation/CoreFoundation.h>
#endif

#include <nfc/nfc.h>

#include <freefare.h>
#include "../libfreefare/freefare_internal.h"

#define NDEF_BUFFER_SIZE 512

Expand Down
4 changes: 2 additions & 2 deletions libfreefare/freefare_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
# define be16toh(x) betoh16(x)
#endif

#if !defined(le32toh) && defined(CFSwapInt32LittleToHost)
#if !defined(le32toh) && defined(HAVE_COREFOUNDATION_COREFOUNDATION_H)
# define be32toh(x) CFSwapInt32BigToHost(x)
# define htobe32(x) CFSwapInt32HostToBig(x)
# define le32toh(x) CFSwapInt32LittleToHost(x)
# define htole32(x) CFSwapInt32HostToLittle(x)
#endif

#if !defined(le16toh) && defined(CFSwapInt16LittleToHost)
#if !defined(le16toh) && defined(HAVE_COREFOUNDATION_COREFOUNDATION_H)
# define be16toh(x) CFSwapInt16BigToHost(x)
# define htobe16(x) CFSwapInt16HostToBig(x)
# define le16toh(x) CFSwapInt16LittleToHost(x)
Expand Down

0 comments on commit b131f74

Please sign in to comment.