@@ -24,6 +24,16 @@ Conditionally defined preprocessor macros:
2424
2525 Defined on HP-UX.
2626
27+ * `_POSIX_PTHREAD_SEMANTICS`
28+
29+ Defined on Solaris and illumos-based systems.
30+
31+ As of Solaris 11.4, the `_POSIX_PTHREAD_SEMANTICS` is obsolete and according
32+ to documentation no header utilizes this anymore. For illumos-based systems,
33+ it's unclear where it is still needed, so at the time of writing, this is
34+ enabled unconditionally for all Solaris and illumos-based systems as enabling
35+ it doesn't cause issues. For other systems, this is irrelevant.
36+
2737## Result variables
2838
2939* `PHP_SYSTEM_EXTENSIONS_CODE`
@@ -116,7 +126,6 @@ target_compile_definitions(
116126 _HPUX_ALT_XOPEN_SOCKET_API=1
117127 _NETBSD_SOURCE=1
118128 _OPENBSD_SOURCE=1
119- _POSIX_PTHREAD_SEMANTICS=1
120129 _TANDEM_SOURCE=1
121130 __STDC_WANT_IEC_60559_ATTRIBS_EXT__=1
122131 __STDC_WANT_IEC_60559_BFP_EXT__=1
@@ -201,14 +210,26 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
201210 endif ()
202211endif ()
203212
213+ ################################################################################
214+ # Check whether to enable _POSIX_PTHREAD_SEMANTICS.
215+ ################################################################################
216+
217+ if (CMAKE_SYSTEM_NAME STREQUAL "SunOS" )
218+ target_compile_definitions (
219+ PHP::SystemExtensions
220+ INTERFACE $<$<COMPILE_LANGUAGE:ASM,C,CXX>:_POSIX_PTHREAD_SEMANTICS>
221+ )
222+
223+ set (_POSIX_PTHREAD_SEMANTICS TRUE )
224+ endif ()
225+
204226################################################################################
205227# Check whether to enable _XOPEN_SOURCE.
206228################################################################################
207229
208230# HP-UX 11.11 didn't define mbstate_t without setting _XOPEN_SOURCE to 500. This
209231# is set conditionally, because BSD-based systems might have issues with this.
210232if (CMAKE_SYSTEM_NAME STREQUAL "HP-UX" )
211- # Reset any possible previous value.
212233 unset (_XOPEN_SOURCE)
213234
214235 cmake_push_check_state(RESET)
@@ -275,7 +296,7 @@ set(PHP_SYSTEM_EXTENSIONS_CODE [[
275296#endif
276297/* Enable POSIX-compatible threading on Solaris. */
277298#ifndef _POSIX_PTHREAD_SEMANTICS
278- # define _POSIX_PTHREAD_SEMANTICS 1
299+ # cmakedefine _POSIX_PTHREAD_SEMANTICS
279300#endif
280301/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
281302#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
0 commit comments