Skip to content

Commit 540f9ab

Browse files
author
Timon Karnezos
committed
Fixed broken build on OS X by conditionally using platform-specific byteswap. Added note about clang incompatibility on OS X and building with gcc. Fixes citusdata#6.
1 parent 6652803 commit 540f9ab

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ Or to build with what's on your path, just:
398398

399399
make
400400

401+
If you're building on OS X with `clang` as the default C/C++ compiler, you'll need to specify `gcc` as your compiler:
402+
403+
make CC=gcc CXX=gcc
404+
401405
Or for the debug build:
402406

403407
DEBUG=1 make

hll.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515

1616
#include <postgres.h> // Needs to be first.
1717

18+
#if defined(__APPLE__)
19+
#include <libkern/OSByteOrder.h>
20+
#define bswap_64 OSSwapInt64
21+
#else
1822
#include <byteswap.h>
23+
#endif
24+
1925
#include <funcapi.h>
2026
#include <math.h>
2127
#include <stdlib.h>

0 commit comments

Comments
 (0)