graphics/dust3d: fix build on powerpc and riscv64

Same issue as devel/onetbb.
This commit is contained in:
Piotr Kubaj 2021-12-24 19:10:57 +00:00
parent ac64d6b1cc
commit f89277b84f
2 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,12 @@ DESKTOP_ENTRIES="Dust3D" "${COMMENT}" "${PORTNAME}" "${PORTNAME}" \
PLIST_FILES= bin/${PORTNAME}
.include <bsd.port.options.mk>
.if ${ARCH} == powerpc || ${ARCH} == riscv64
EXTRA_PATCHES= ${FILESDIR}/extra-patch-thirdparty_instant-meshes_instant-meshes-dust3d_ext_tbb_src_tbb_tools__api_ittnotify__config.h
.endif
post-patch:
@${REINPLACE_CMD} -e '/PLATFORM =/s,Linux,${OPSYS},' \
${WRKSRC}/${PORTNAME}.pro

View File

@ -0,0 +1,11 @@
--- thirdparty/instant-meshes/instant-meshes-dust3d/ext/tbb/src/tbb/tools_api/ittnotify_config.h.orig 2021-06-30 18:42:09 UTC
+++ thirdparty/instant-meshes/instant-meshes-dust3d/ext/tbb/src/tbb/tools_api/ittnotify_config.h
@@ -335,7 +335,7 @@ ITT_INLINE long
__itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE;
ITT_INLINE long __itt_interlocked_increment(volatile long* ptr)
{
- return __TBB_machine_fetchadd4(ptr, 1) + 1L;
+ return __atomic_fetch_add(ptr, 1L, __ATOMIC_SEQ_CST) + 1L;
}
#endif /* ITT_SIMPLE_INIT */