<pre style='margin:0'>
Chris Jones (cjones051073) pushed a commit to branch master
in repository macports-legacy-support.
</pre>
<p><a href="https://github.com/macports/macports-legacy-support/commit/8af62cfd2c9b97990df91400a6dcbfbd08ab97e0">https://github.com/macports/macports-legacy-support/commit/8af62cfd2c9b97990df91400a6dcbfbd08ab97e0</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 8af62cfd2c9b97990df91400a6dcbfbd08ab97e0
</span>Author: Marcus Calhoun-Lopez <marcuscalhounlopez@gmail.com>
AuthorDate: Thu Apr 7 12:07:32 2022 -0700
<span style='display:block; white-space:pre;color:#404040;'> add `pthread_setname_np` function
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Rust requires this function.
</span>---
README.md | 6 +++++-
include/MacportsLegacySupport.h | 2 ++
include/pthread.h | 9 +++++++++
src/pthread_setname_np.c | 25 +++++++++++++++++++++++++
4 files changed, 41 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/README.md b/README.md
</span><span style='display:block; white-space:pre;color:#808080;'>index fe9603e..2151d9b 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/README.md
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/README.md
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -45,10 +45,14 @@ Wrapped headers and replaced functions are:
</span> <td>OSX10.5</td>
</tr>
<tr>
<span style='display:block; white-space:pre;background:#ffe0e0;'>- <td><code>pthread.h</code></td>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <td rowspan="2"><code>pthread.h</code></td>
</span> <td>Adds <code>PTHREAD_RWLOCK_INITIALIZER</code></td>
<td>OSX10.4</td>
</tr>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ <tr>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <td>Adds <code>pthread_setname_np</code> function</td>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <td>OSX10.5</td>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ </tr>
</span> <tr>
<td><code>stdio.h</code></td>
<td>Adds <code>dprintf</code>, <code>getline</code>, and <code>getdelim</code> functions</td>
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/MacportsLegacySupport.h b/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;color:#808080;'>index cc5ce53..cbfd53f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/MacportsLegacySupport.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -149,6 +149,8 @@
</span> /* flsll */
#define __MP_LEGACY_SUPPORT_FLSLL__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090)
<span style='display:block; white-space:pre;background:#e0ffe0;'>+/* pthread_setname_np */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#define __MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__ (__APPLE__ && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060)
</span>
/* Compound macros, bundling functionality needed by multiple single features. */
#define __MP_LEGACY_SUPPORT_NEED_ATCALL_MACROS__ (__MP_LEGACY_SUPPORT_ATCALLS__ || __MP_LEGACY_SUPPORT_SETATTRLISTAT__)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/include/pthread.h b/include/pthread.h
</span><span style='display:block; white-space:pre;color:#808080;'>index f01441c..b9372a9 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/include/pthread.h
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/include/pthread.h
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -31,4 +31,13 @@
</span> #endif
#endif /* __MP_LEGACY_SUPPORT_PTHREAD_RWLOCK__ */
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__BEGIN_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int pthread_setname_np(const char *);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__ */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+__MP__END_DECLS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> #endif /* _MACPORTS_PTHREAD_H_ */
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/pthread_setname_np.c b/src/pthread_setname_np.c
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..383dfac
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/pthread_setname_np.c
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,25 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Until such time as this behavior can be emulated, do nothing and return success.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* This is what the MacPorts SpiderMonkey does:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://github.com/macports/macports-ports/commit/50cdf084768436a421e2c6d05e995d122bc93bca
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* This is what the MacPorts LLVM does:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://github.com/macports/macports-ports/blob/master/lang/llvm-14/files/0007-Threading-Only-call-pthread_setname_np-if-we-have-it.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* This is what upstream dav1d does:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://code.videolan.org/videolan/dav1d/-/blob/87f9a81cd770e49394a45deca7a3df41243de00b/src/thread.h#L182
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ vs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://code.videolan.org/videolan/dav1d/-/blob/87f9a81cd770e49394a45deca7a3df41243de00b/src/thread.h#L182
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+* This is what upstream Rust does:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://github.com/rust-lang/rust/blob/100f12d17026fccfc5d80527b5976dd66b228b13/library/std/src/sys/unix/thread.rs#L137
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ vs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ https://github.com/rust-lang/rust/blob/100f12d17026fccfc5d80527b5976dd66b228b13/library/std/src/sys/unix/thread.rs#L199
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+*/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+/* MP support header */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#include "MacportsLegacySupport.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#if __MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+int pthread_setname_np(const char *name) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#endif /* __MP_LEGACY_SUPPORT_PTHREAD_SETNAME_NP__ */
</span></pre><pre style='margin:0'>
</pre>