pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/math/z3 Re-introduce support for NetBSD in src/util/sc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7d0ca51dd6d3
branches:  trunk
changeset: 377189:7d0ca51dd6d3
user:      khorben <khorben%pkgsrc.org@localhost>
date:      Tue Mar 13 21:20:34 2018 +0000

description:
Re-introduce support for NetBSD in src/util/scoped_timer.cpp

I forgot to patch this part in the latest update; sorry.
This has now been submitted upstream as well.

Originally from dholland@.

Compile-tested on NetBSD/amd64.

Bump PKGREVISION.

diffstat:

 math/z3/Makefile                                 |   3 +-
 math/z3/distinfo                                 |   3 +-
 math/z3/patches/patch-src_util_scoped__timer.cpp |  59 ++++++++++++++++++++++++
 3 files changed, 63 insertions(+), 2 deletions(-)

diffs (91 lines):

diff -r 68705b9a2024 -r 7d0ca51dd6d3 math/z3/Makefile
--- a/math/z3/Makefile  Tue Mar 13 21:19:52 2018 +0000
+++ b/math/z3/Makefile  Tue Mar 13 21:20:34 2018 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.8 2018/03/13 00:31:16 khorben Exp $
+# $NetBSD: Makefile,v 1.9 2018/03/13 21:20:34 khorben Exp $
 
 .include "Makefile.common"
 
+PKGREVISION=   1
 COMMENT=       The Z3 theorem prover / SMT solver
 
 .include "options.mk"
diff -r 68705b9a2024 -r 7d0ca51dd6d3 math/z3/distinfo
--- a/math/z3/distinfo  Tue Mar 13 21:19:52 2018 +0000
+++ b/math/z3/distinfo  Tue Mar 13 21:20:34 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.4 2018/03/13 00:31:16 khorben Exp $
+$NetBSD: distinfo,v 1.5 2018/03/13 21:20:34 khorben Exp $
 
 SHA1 (z3-4.5.0.tar.gz) = 6f4e94e025fcc2fa2896524d8fbb9de0b3033854
 RMD160 (z3-4.5.0.tar.gz) = 81121307ac83f42989da49efda31964a94f7f5d5
@@ -6,4 +6,5 @@
 Size (z3-4.5.0.tar.gz) = 3573695 bytes
 SHA1 (patch-configure) = 8d5fe787f15fe781c3c23cee27058f898de8c95e
 SHA1 (patch-scripts_mk__util.py) = f0a7cfabdbf9b6c1eb92e75f381d8a3f8a088d35
+SHA1 (patch-src_util_scoped__timer.cpp) = 68e0bdee94d54c93f3d493bf71abebcdccd921ba
 SHA1 (patch-src_util_stopwatch.h) = dbeab175ed4f507d5378f1966f8ed173c4c9a9a7
diff -r 68705b9a2024 -r 7d0ca51dd6d3 math/z3/patches/patch-src_util_scoped__timer.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/math/z3/patches/patch-src_util_scoped__timer.cpp  Tue Mar 13 21:20:34 2018 +0000
@@ -0,0 +1,59 @@
+$NetBSD: patch-src_util_scoped__timer.cpp,v 1.1 2018/03/13 21:20:34 khorben Exp $
+
+Add support for NetBSD.
+
+--- src/util/scoped_timer.cpp.orig     2016-11-07 22:02:30.000000000 +0000
++++ src/util/scoped_timer.cpp
+@@ -33,8 +33,8 @@ Revision History:
+ #include<sys/time.h>
+ #include<sys/errno.h>
+ #include<pthread.h>
+-#elif defined(_LINUX_) || defined(_FREEBSD_)
+-// Linux
++#elif defined(_LINUX_) || defined(_FREEBSD_) || defined(_NETBSD_)
++// Linux & FreeBSD & NetBSD
+ #include<errno.h>
+ #include<pthread.h>
+ #include<sched.h>
+@@ -66,8 +66,8 @@ struct scoped_timer::imp {
+     pthread_mutex_t  m_mutex;
+     pthread_cond_t   m_condition_var;
+     struct timespec  m_end_time;
+-#elif defined(_LINUX_) || defined(_FREEBSD_)
+-    // Linux & FreeBSD
++#elif defined(_LINUX_) || defined(_FREEBSD_) || defined(_NETBSD_)
++    // Linux & FreeBSD & NetBSD
+     pthread_t       m_thread_id;
+     pthread_mutex_t m_mutex;
+     pthread_cond_t  m_cond;
+@@ -103,7 +103,7 @@ struct scoped_timer::imp {
+ 
+         return st;
+     }
+-#elif defined(_LINUX_) || defined(_FREEBSD_)
++#elif defined(_LINUX_) || defined(_FREEBSD_) || defined(_NETBSD_)
+     static void* thread_func(void *arg) {
+         scoped_timer::imp *st = static_cast<scoped_timer::imp*>(arg);
+ 
+@@ -166,8 +166,8 @@ struct scoped_timer::imp {
+ 
+         if (pthread_create(&m_thread_id, &m_attributes, &thread_func, this) != 0)
+             throw default_exception("failed to start timer thread");
+-#elif defined(_LINUX_) || defined(_FREEBSD_)
+-        // Linux & FreeBSD
++#elif defined(_LINUX_) || defined(_FREEBSD_) || defined(_NETBSD_)
++        // Linux & FreeBSD & NetBSD
+         m_ms = ms;
+         m_initialized = false;
+         ENSURE(pthread_mutex_init(&m_mutex, NULL) == 0);
+@@ -206,8 +206,8 @@ struct scoped_timer::imp {
+             throw default_exception("failed to destroy pthread condition variable");
+         if (pthread_attr_destroy(&m_attributes) != 0)
+             throw default_exception("failed to destroy pthread attributes object");
+-#elif defined(_LINUX_) || defined(_FREEBSD_)
+-        // Linux & FreeBSD
++#elif defined(_LINUX_) || defined(_FREEBSD_) || defined(_NETBSD_)
++        // Linux & FreeBSD & NetBSD
+         bool init = false;
+ 
+         // spin until timer thread has been created



Home | Main Index | Thread Index | Old Index