math/oink: Update g20210704 -> g20210710 and make atomics portable

PR:		262513
This commit is contained in:
Robert Clausecker 2022-03-12 18:26:31 -08:00 committed by Yuri Victorovich
parent b68abca341
commit de445d5dd9
3 changed files with 24 additions and 20 deletions

View file

@ -1,12 +1,7 @@
PORTNAME= oink
DISTVERSION= g20210704
PORTREVISION= 1
DISTVERSION= g20210710
CATEGORIES= math
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/
PATCHFILES= cd8c62bc1900ffee6d933fa31cbdd954560c286b.patch:-p1 # Fix build on FreeBSD
PATCHFILES+= a5c10784a472c42bab5a4df0ef29799011bc30b1.patch:-p1 # Fix installed cmake file path
MAINTAINER= yuri@FreeBSD.org
COMMENT= Modern parity game solvers written in C++
@ -20,7 +15,7 @@ USE_LDCONFIG= yes
USE_GITHUB= yes
GH_ACCOUNT= trolando
GH_TAGNAME= c1259fe
GH_TAGNAME= 3327c54
CMAKE_ON= BUILD_SHARED_LIBS

View file

@ -1,7 +1,3 @@
TIMESTAMP = 1625512740
SHA256 (trolando-oink-g20210704-c1259fe_GH0.tar.gz) = 46f6b06f905ea94efadf2adce3923ed7df2775f9101e505eebe787b7b94e5549
SIZE (trolando-oink-g20210704-c1259fe_GH0.tar.gz) = 178173
SHA256 (cd8c62bc1900ffee6d933fa31cbdd954560c286b.patch) = eb88af6421600c8538f229369412289a46a87be3a6c4419642d02b4841453325
SIZE (cd8c62bc1900ffee6d933fa31cbdd954560c286b.patch) = 764
SHA256 (a5c10784a472c42bab5a4df0ef29799011bc30b1.patch) = 4b103ff0fe318e97ea370ce1c82b91ddbb998f5266d340306138b9a41487bea8
SIZE (a5c10784a472c42bab5a4df0ef29799011bc30b1.patch) = 796
TIMESTAMP = 1647124747
SHA256 (trolando-oink-g20210710-3327c54_GH0.tar.gz) = 5c4f1658531fcfca394cb46412143ccebc70153953d398942609b18f999a136a
SIZE (trolando-oink-g20210710-3327c54_GH0.tar.gz) = 178207

View file

@ -1,13 +1,26 @@
--- src/lace.h.orig 2021-07-12 11:27:04 UTC
--- src/lace.h.orig 2021-07-10 20:56:55 UTC
+++ src/lace.h
@@ -293,7 +293,11 @@ void lace_yield(WorkerP *__lace_worker, Task *__lace_d
@@ -17,6 +17,11 @@
*/
#include <unistd.h>
+#ifdef __cplusplus
+#include <atomic>
+#else
+#include <stdatomic.h>
+#endif
#include <stdint.h>
#include <stdio.h>
#include <pthread.h> /* for pthread_t */
@@ -293,7 +298,11 @@ void lace_yield(WorkerP *__lace_worker, Task *__lace_d
#endif
#ifndef mfence
+#if defined(__amd64__) || defined(__i386__)
#define mfence() { asm volatile("mfence" ::: "memory"); }
+#elif defined(__powerpc__)
+#define mfence() { asm volatile("sync" ::: "memory"); }
-#define mfence() { asm volatile("mfence" ::: "memory"); }
+#ifdef __cplusplus
+#define mfence() std::atomic_thread_fence(std::memory_order_seq_cst)
+#else
+#define mfence() atomic_thread_fence(memory_order_seq_cst)
+#endif
#endif