diff options
author | pkubaj <pkubaj@FreeBSD.org> | 2019-06-24 15:24:28 +0800 |
---|---|---|
committer | pkubaj <pkubaj@FreeBSD.org> | 2019-06-24 15:24:28 +0800 |
commit | 46a60370fdc446e467238eeb6f785547b8af1010 (patch) | |
tree | 1245e219dfc45cdd56f200cff31d64c65889c976 /ftp | |
parent | bfec048acaa49f8ed8d1601eae606de5bcf4caa6 (diff) | |
download | freebsd-ports-gnome-46a60370fdc446e467238eeb6f785547b8af1010.tar.gz freebsd-ports-gnome-46a60370fdc446e467238eeb6f785547b8af1010.tar.zst freebsd-ports-gnome-46a60370fdc446e467238eeb6f785547b8af1010.zip |
ftp/R-cran-curl: fix build on big-endian architectures
BSWAP_32 is undefined on FreeBSD, use bswap32.
It also needs sys/endian.h include.
Needed because of:
/wrkdirs/usr/ports/ftp/R-cran-curl/work/stage/usr/local/lib/R/library/00LOCK-curl/00new/curl/libs/curl.so: Undefined symbol "BSWAP_32"
PR: 238704
Approved by: tota (maintainer), tcberner (mentor)
Differential Revision: https://reviews.freebsd.org/D20726
Diffstat (limited to 'ftp')
-rw-r--r-- | ftp/R-cran-curl/files/patch-src_curl.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ftp/R-cran-curl/files/patch-src_curl.c b/ftp/R-cran-curl/files/patch-src_curl.c new file mode 100644 index 000000000000..fe6681a9e796 --- /dev/null +++ b/ftp/R-cran-curl/files/patch-src_curl.c @@ -0,0 +1,20 @@ +--- src/curl.c.orig 2019-06-19 09:02:26 UTC ++++ src/curl.c +@@ -24,6 +24,8 @@ + #define BSWAP_32 OSSwapInt32 + #elif (defined(__OpenBSD__)) + #define BSWAP_32(x) swap32(x) ++#elif (defined(__FreeBSD__)) ++#include <sys/endian.h> + #elif (defined(__GLIBC__)) + #include <byteswap.h> + #define BSWAP_32(x) bswap_32(x) +@@ -146,7 +148,7 @@ static size_t rcurl_read(void *target, size_t sz, size + static int rcurl_fgetc(Rconnection con) { + int x = 0; + #ifdef WORDS_BIGENDIAN +- return rcurl_read(&x, 1, 1, con) ? BSWAP_32(x) : R_EOF; ++ return rcurl_read(&x, 1, 1, con) ? bswap32(x) : R_EOF; + #else + return rcurl_read(&x, 1, 1, con) ? x : R_EOF; + #endif |