pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

vlc-git: Support bswap{16,32,64} on NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Feb 27 05:07:42 2018 +0100
Changeset:	1cb1a81c603af4d4d7597568cf2cbde7e6352837

Modified Files:
	vlc-git/distinfo
	vlc-git/patches/patch-configure.ac
	vlc-git/patches/patch-include_vlc__common.h

Log Message:
vlc-git: Support bswap{16,32,64} on NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1cb1a81c603af4d4d7597568cf2cbde7e6352837

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 vlc-git/distinfo                            |  4 +--
 vlc-git/patches/patch-configure.ac          | 46 ++++++++++++++++++++++++++++-
 vlc-git/patches/patch-include_vlc__common.h | 35 ++++++++++++++++++++++
 3 files changed, 82 insertions(+), 3 deletions(-)

diffs:
diff --git a/vlc-git/distinfo b/vlc-git/distinfo
index 3906ba4f88..848b1ffcbd 100644
--- a/vlc-git/distinfo
+++ b/vlc-git/distinfo
@@ -4,5 +4,5 @@ SHA1 (vlc-3.0.0.tar.xz) = 50610841b060321242793cf6ad3d58759dc5973b
 RMD160 (vlc-3.0.0.tar.xz) = c0ad23fdf03ae5c9524ed05c7bc0d63745587287
 SHA512 (vlc-3.0.0.tar.xz) = 9bdc64e16ddd2e8d2693179f2fcac8462d7defff186262a049ba325ef00882fbd75a9d323b506ba06876a8168fd5e90319837c8dcd136b206161e67748c2a9f7
 Size (vlc-3.0.0.tar.xz) = 25191148 bytes
-SHA1 (patch-configure.ac) = acc8f8dece735d6e8c44f030e8e6a1552a4c9815
-SHA1 (patch-include_vlc__common.h) = 4f6cc8ba28fa46e82d371c1567be6217c2cbc77b
+SHA1 (patch-configure.ac) = b13af8a11e10653263c1c9855737964625d4e3a5
+SHA1 (patch-include_vlc__common.h) = c15dca0f41ecf7dfcdc6abe6244ad66ad48a2346
diff --git a/vlc-git/patches/patch-configure.ac b/vlc-git/patches/patch-configure.ac
index ad5e007062..9b94325db5 100644
--- a/vlc-git/patches/patch-configure.ac
+++ b/vlc-git/patches/patch-configure.ac
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- configure.ac.orig	2018-02-23 21:03:32.884950743 +0000
+--- configure.ac.orig	2018-02-23 21:03:32.000000000 +0000
 +++ configure.ac
 @@ -590,7 +590,7 @@ dnl Check for system libs needed
  need_libc=false
@@ -11,3 +11,47 @@ $NetBSD$
  AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
  AC_REPLACE_FUNCS([gettimeofday])
  AC_CHECK_FUNC(fdatasync,,
+@@ -852,6 +852,43 @@ AC_CHECK_HEADERS([features.h getopt.h li
+ dnl  MacOS
+ AC_CHECK_HEADERS([xlocale.h])
+ 
++dnl  byte swap
++AC_MSG_CHECKING([bswap16])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++#include <sys/types.h>
++#include <stdint.h>]], [
++uint16_t A = bswap16(1);
++])], [
++  AC_MSG_RESULT([yes])
++  AC_DEFINE([HAVE_BSWAP16], [1], [Define to 1 if you have the `bswap16` function.])
++], [
++  AC_MSG_RESULT([no])
++])
++
++AC_MSG_CHECKING([bswap32])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++#include <sys/types.h>
++#include <stdint.h>]], [
++uint32_t A = bswap32(1);
++])], [
++  AC_MSG_RESULT([yes])
++  AC_DEFINE([HAVE_BSWAP32], [1], [Define to 1 if you have the `bswap32` function.])
++], [
++  AC_MSG_RESULT([no])
++])
++
++AC_MSG_CHECKING([bswap64])
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++#include <sys/types.h>
++#include <stdint.h>]], [
++uint64_t A = bswap64(1);
++])], [
++  AC_MSG_RESULT([yes])
++  AC_DEFINE([HAVE_BSWAP64], [1], [Define to 1 if you have the `bswap64` function.])
++], [
++  AC_MSG_RESULT([no])
++])
++
+ dnl LP64 and LLP64 architectures had better define ssize_t by themselves...
+ AH_TEMPLATE(ssize_t, [Define to `int' if <stddef.h> does not define.]) dnl ` (fix VIM syntax highlight
+ AC_CHECK_TYPE(ssize_t,, [
diff --git a/vlc-git/patches/patch-include_vlc__common.h b/vlc-git/patches/patch-include_vlc__common.h
index c5f0763669..5df7ab9108 100644
--- a/vlc-git/patches/patch-include_vlc__common.h
+++ b/vlc-git/patches/patch-include_vlc__common.h
@@ -29,3 +29,38 @@ $NetBSD$
  
  VLC_USED
  static inline unsigned (parity)(unsigned x)
+@@ -602,13 +607,16 @@ static inline unsigned (parity)(unsigned
+ #endif
+ }
+ 
++#ifndef HAVE_BSWAP16
+ /** Byte swap (16 bits) */
+ VLC_USED
+ static inline uint16_t (bswap16)(uint16_t x)
+ {
+     return (x << 8) | (x >> 8);
+ }
++#endif
+ 
++#ifndef HAVE_BSWAP32
+ /** Byte swap (32 bits) */
+ VLC_USED
+ static inline uint32_t (bswap32)(uint32_t x)
+@@ -622,7 +630,9 @@ static inline uint32_t (bswap32)(uint32_
+          | ((x & 0xFF000000) >> 24);
+ #endif
+ }
++#endif
+ 
++#ifndef HAVE_BSWAP64
+ /** Byte swap (64 bits) */
+ VLC_USED
+ static inline uint64_t (bswap64)(uint64_t x)
+@@ -649,6 +659,7 @@ static inline uint64_t (bswap64)(uint64_
+          | ((x & 0xFF00000000000000ULL) >> 56);
+ #endif
+ }
++#endif
+ 
+ /* Integer overflow */
+ static inline bool uadd_overflow(unsigned a, unsigned b, unsigned *res)


Home | Main Index | Thread Index | Old Index