diff options
author | joerg <joerg> | 2015-09-23 12:02:27 +0000 |
---|---|---|
committer | joerg <joerg> | 2015-09-23 12:02:27 +0000 |
commit | 3e449d4f53b35b2a49c7085f207dda1ecf5eee5a (patch) | |
tree | 5bd04178fc920595c1f839f9a33fc6ae9bcf82ca /multimedia | |
parent | 2650a123c7c950de9ff97049cb6c44f34b1276c1 (diff) | |
download | pkgsrc-3e449d4f53b35b2a49c7085f207dda1ecf5eee5a.tar.gz |
Remove NetBSD specific clang hack, stdatomic.h is now installed.
Rework vlc_atomic.h to work with <atomic> to avoid overlap.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/vlc21/distinfo | 3 | ||||
-rw-r--r-- | multimedia/vlc21/hacks.mk | 15 | ||||
-rw-r--r-- | multimedia/vlc21/patches/patch-include_vlc__atomic.h | 43 |
3 files changed, 45 insertions, 16 deletions
diff --git a/multimedia/vlc21/distinfo b/multimedia/vlc21/distinfo index 35280b6b391..a4c2a01b4e2 100644 --- a/multimedia/vlc21/distinfo +++ b/multimedia/vlc21/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2015/01/23 16:01:40 wiz Exp $ +$NetBSD: distinfo,v 1.3 2015/09/23 12:02:27 joerg Exp $ SHA1 (vlc-2.1.5.tar.xz) = 7f1cb6324a04cf393896bbb5976ca9febd7b3efc RMD160 (vlc-2.1.5.tar.xz) = 4a18210f0f01ac8dfaf166926ab10eea6d97fbae @@ -19,6 +19,7 @@ SHA1 (patch-av) = f496ee18de5b0b0764479eb9c6520666ffad67ba SHA1 (patch-ca) = 20481ea8779e20d5632ef8073bd5f3acad21be12 SHA1 (patch-compat_Makefile.am) = c2f22208b5bdfbd6349e2200c5067d89db90259f SHA1 (patch-compat_Makefile.in) = fa8f2fc63d80169d760838e4080fd79b41b20bb3 +SHA1 (patch-include_vlc__atomic.h) = 24e6e27c44a1d2776e89d0c3624eab16ad3b074d SHA1 (patch-modules_access_directory.c) = e36df1da5b788e12e9fc7d94663dd69d86fe4f7a SHA1 (patch-modules_access_rtp_Makefile.in) = 3d8dccd16a486b2fe4fa3f7ef7a7cca3dd2c00de SHA1 (patch-modules_audio__output_pulse.c) = 39fe574ef63ad3c4ce9ca4db92a80e42755cdde9 diff --git a/multimedia/vlc21/hacks.mk b/multimedia/vlc21/hacks.mk deleted file mode 100644 index 0c53713ae8f..00000000000 --- a/multimedia/vlc21/hacks.mk +++ /dev/null @@ -1,15 +0,0 @@ -# $NetBSD: hacks.mk,v 1.1 2015/03/16 21:51:01 tnn Exp $ - -.if !defined(VLC21_HACKS_MK) -VLC21_HACKS_MK= # empty - -# vlc_atomic.h rightly assumes "uses clang (support for C11)" implies -# "ships stdatomic.h" but for us this is not yet the case. -# This hack should be removed when -current has stdatomic.h. -.if ${OPSYS} == "NetBSD" && \ - exists(/usr/bin/clang) && \ - !exists(/usr/include/stdatomic.h) -CPPFLAGS+= -D__STDC_NO_ATOMICS__ -.endif - -.endif diff --git a/multimedia/vlc21/patches/patch-include_vlc__atomic.h b/multimedia/vlc21/patches/patch-include_vlc__atomic.h new file mode 100644 index 00000000000..cb6ecff3e37 --- /dev/null +++ b/multimedia/vlc21/patches/patch-include_vlc__atomic.h @@ -0,0 +1,43 @@ +$NetBSD: patch-include_vlc__atomic.h,v 1.1 2015/09/23 12:02:27 joerg Exp $ + +--- include/vlc_atomic.h.orig 2015-09-21 14:00:58.000000000 +0000 ++++ include/vlc_atomic.h +@@ -25,13 +25,26 @@ + * \file + * Atomic operations do not require locking, but they are not very powerful. + */ ++#if (__STDC_VERSION__ >= 201112L) && !defined (__STDC_NO_ATOMICS__) ++#define HAS_STDATOMIC_H ++#elif __cplusplus - 0 >= 201103L ++#define HAS_ATOMIC ++#elif defined(__has_include) ++# if defined(__cplusplus) && __has_include(<atomic>) ++# define HAS_ATOMIC ++# elif __has_include(<stdatomic.h>) ++# define HAS_STDATOMIC_H ++# endif ++#endif + +-# if !defined (__cplusplus) && (__STDC_VERSION__ >= 201112L) \ +- && !defined (__STDC_NO_ATOMICS__) + ++# if defined(HAS_STDATOMIC_H) + /*** Native C11 atomics ***/ + # include <stdatomic.h> +- ++# elif defined(HAS_ATOMIC) ++# include <atomic> ++using std::atomic_uint_least32_t; ++using std::atomic_uintptr_t; + # else + + # define ATOMIC_FLAG_INIT false +@@ -310,7 +323,7 @@ typedef uintmax_t atomic_uintmax + /** + * Memory storage space for an atom. Never access it directly. + */ +-typedef union ++typedef struct + { + atomic_uintptr_t u; + } vlc_atomic_t; |