Skip to content

Commit

Permalink
Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT
Browse files Browse the repository at this point in the history
Avoids (Solaris SPARC) issue:
  zend_fibers.c:77:9: error: unknown type name 'ucontext_t'

Closes GH-7773.
  • Loading branch information
psumbera authored and cmb69 committed Dec 20, 2021
1 parent ca3f7b0 commit 069bbf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ PHP NEWS
(cmb)
. Fixed bug GH-7757 (Multi-inherited final constant causes fatal error).
(cmb)
. Fixed zend_fibers.c build with ZEND_FIBER_UCONTEXT. (Petr Sumbera)

- Filter:
. Fixed FILTER_FLAG_NO_RES_RANGE flag. (Yifan Tong)
Expand Down
5 changes: 4 additions & 1 deletion Zend/zend_fibers.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
# include <valgrind/valgrind.h>
#endif

#ifdef ZEND_FIBER_UCONTEXT
# include <ucontext.h>
#endif

#ifndef ZEND_WIN32
# include <unistd.h>
# include <sys/mman.h>
Expand Down Expand Up @@ -118,7 +122,6 @@ static zend_always_inline void zend_fiber_restore_vm_state(zend_fiber_vm_state *
}

#ifdef ZEND_FIBER_UCONTEXT
# include <ucontext.h>
ZEND_TLS zend_fiber_transfer *transfer_data;
#else
/* boost_context_data is our customized definition of struct transfer_t as
Expand Down

1 comment on commit 069bbf3

@andypost
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR it fixed https://bugs.php.net/bug.php?id=81689 and allowed to build on more the ppc* arches

Please # to comment.