diff --git a/examples/felica-read-ndef.c b/examples/felica-read-ndef.c index 55483d7..60a9593 100644 --- a/examples/felica-read-ndef.c +++ b/examples/felica-read-ndef.c @@ -30,9 +30,14 @@ # include #endif +#if defined(HAVE_COREFOUNDATION_COREFOUNDATION_H) +# include +#endif + #include #include +#include "../libfreefare/freefare_internal.h" #define NDEF_BUFFER_SIZE 512 diff --git a/libfreefare/freefare_internal.h b/libfreefare/freefare_internal.h index b792ced..f7f8568 100644 --- a/libfreefare/freefare_internal.h +++ b/libfreefare/freefare_internal.h @@ -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)