Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pixz compile on FreeBSD #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ifneq ($(shell gcc -v 2>&1 | grep 'Apple Inc'),)
APPLE=1
endif

LIBPREFIX = /Library/Fink/sl64 /opt/local
LIBPREFIX = /Library/Fink/sl64 /opt/local /usr /usr/local
ifdef APPLE
ifeq ($(CC),gcc)
LDFLAGS += -search_paths_first
Expand All @@ -26,7 +26,7 @@ all: $(PROGS)
$(COMPILE) $@ $<

$(PROGS): %: %.o $(COMMON)
$(LD) $@ $^ -llzma -larchive
$(LD) $@ $^ -llzma -larchive -pthread

clean:
rm -f *.o $(PROGS)
Expand Down
14 changes: 14 additions & 0 deletions endian.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,18 @@ void xle64enc(uint8_t *d, uint64_t n) {
}


#elif defined(__FreeBSD__)

#include <stdint.h>
#include <sys/endian.h>

uint64_t xle64dec(const uint8_t *d) {
return le64toh(*(uint64_t*)d);
}

void xle64enc(uint8_t *d, uint64_t n) {
*(uint64_t*)d = htole64(n);
}


#endif