Skip to content

Commit

Permalink
Merge pull request xrootd#1766 from barracuda156/darwin
Browse files Browse the repository at this point in the history
xrootd: fix missing byteswap.h error on MacOS build with gcc
  • Loading branch information
smithdh committed Nov 28, 2022
2 parents 3b87b99 + 1bcee03 commit 8e1e528
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/XrdOssCsi/XrdOssCsiTagstoreFile.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,19 @@

#include <memory>
#include <mutex>

#if defined(__GLIBC__) || defined(__BIONIC__) || defined(__CYGWIN__)
#include <byteswap.h>
#elif defined(__APPLE__)
// Make sure that byte swap functions are not already defined.
#if !defined(bswap_16)
// Mac OS X / Darwin features
#include <libkern/OSByteOrder.h>
#define bswap_16(x) OSSwapInt16(x)
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
#endif
#endif

class XrdOssCsiTagstoreFile : public XrdOssCsiTagstore
{
Expand Down

0 comments on commit 8e1e528

Please sign in to comment.