Fixed Mac OSX support. Fixed PHP 8.2 nullable string issues.

This commit is contained in:
cubiclesoft
2023-06-28 10:59:26 -07:00
parent 1c8b2e5306
commit 36d5be0e33
4 changed files with 31 additions and 13 deletions

View File

@@ -19,12 +19,29 @@ if test "$PHP_SYNC" != "no"; then
], [
have_shm_open=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_ERROR([shm_open() is not available on this platform])
])
PHP_ADD_LIBRARY(rt,,SYNC_SHARED_LIBADD)
PHP_SUBST(SYNC_SHARED_LIBADD)
PHP_ADD_LIBRARY(rt,,SYNC_SHARED_LIBADD)
PHP_SUBST(SYNC_SHARED_LIBADD)
], [
AC_MSG_RESULT([no (attempting fallback)])
dnl # Fallback attempt to link without -lrt.
AC_MSG_CHECKING([for shm_open in -pthread])
LIBS="$SAVED_LIBS -pthread"
AC_TRY_LINK([
#include <fcntl.h>
#include <sys/mman.h>
], [
int fp = shm_open("", O_RDWR | O_CREAT | O_EXCL, 0666);
], [
have_shm_open=yes
AC_MSG_RESULT([yes])
], [
AC_MSG_ERROR([shm_open() is not available on this platform])
])
])
dnl # Finish defining the basic extension support.
AC_DEFINE(HAVE_SYNC, 1, [Whether you have synchronization object support])

View File

@@ -10,10 +10,10 @@
<email>cubic@php.net</email>
<active>yes</active>
</lead>
<date>2021-04-09</date>
<date>2023-06-28</date>
<time>05:00:00</time>
<version>
<release>1.1.2</release>
<release>1.1.3</release>
<api>1.1.0</api>
</version>
<stability>
@@ -22,7 +22,8 @@
</stability>
<license uri="http://opensource.org/licenses/MIT">MIT License</license>
<notes>
- Fixed missing macros for PHP 8 (thanks Remi).
- Fixed Mac OSX support.
- Fixed PHP 8.2 nullability issues.
</notes>
<contents>
<dir name="/">

View File

@@ -12,7 +12,7 @@
extern zend_module_entry sync_module_entry;
#define phpext_sync_ptr &sync_module_entry
#define PHP_SYNC_VERSION "1.1.2"
#define PHP_SYNC_VERSION "1.1.3"
#ifdef PHP_WIN32
# define PHP_SYNC_API __declspec(dllexport)

8
sync.c
View File

@@ -885,7 +885,7 @@ PHP_METHOD(sync_Mutex, __construct)
size_t Pos, TempSize;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &name, &name_len) == FAILURE) return;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &name, &name_len) == FAILURE) return;
obj = (sync_Mutex_object *)PORTABLE_zend_object_store_get_object();
@@ -1126,7 +1126,7 @@ PHP_METHOD(sync_Semaphore, __construct)
size_t Pos, TempSize;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sll", &name, &name_len, &initialval, &autounlock) == FAILURE) return;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!ll", &name, &name_len, &initialval, &autounlock) == FAILURE) return;
obj = (sync_Semaphore_object *)PORTABLE_zend_object_store_get_object();
@@ -1342,7 +1342,7 @@ PHP_METHOD(sync_Event, __construct)
size_t Pos, TempSize;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sll", &name, &name_len, &manual, &prefire) == FAILURE) return;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!ll", &name, &name_len, &manual, &prefire) == FAILURE) return;
obj = (sync_Event_object *)PORTABLE_zend_object_store_get_object();
@@ -1675,7 +1675,7 @@ PHP_METHOD(sync_ReaderWriter, __construct)
size_t Pos, TempSize;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &name, &name_len, &autounlock) == FAILURE) return;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!l", &name, &name_len, &autounlock) == FAILURE) return;
obj = (sync_ReaderWriter_object *)PORTABLE_zend_object_store_get_object();