@@ -133,13 +133,21 @@ typedef struct {
133133} php_crypto_stream_data ;
134134
135135/* {{{ php_crypto_stream_write */
136+ #if PHP_VERSION_ID < 70400
136137static size_t php_crypto_stream_write (php_stream * stream ,
138+ #else
139+ static ssize_t php_crypto_stream_write (php_stream * stream ,
140+ #endif
137141 const char * buf , size_t count TSRMLS_DC )
138142{
139143 php_crypto_stream_data * data = (php_crypto_stream_data * ) stream -> abstract ;
140144 int bytes_written = BIO_write (data -> bio , buf , count > INT_MAX ? INT_MAX : count );
141145
146+ #if PHP_VERSION_ID < 70400
142147 return bytes_written <= 0 ? 0 : (size_t ) bytes_written ;
148+ #else
149+ return bytes_written ;
150+ #endif
143151}
144152/* }}} */
145153
@@ -256,7 +264,11 @@ static void php_crypto_stream_auth_save_result(php_stream *stream, int ok)
256264/* }}} */
257265
258266/* {{{ php_crypto_stream_read */
267+ #if PHP_VERSION_ID < 70400
259268static size_t php_crypto_stream_read (php_stream * stream , char * buf , size_t count TSRMLS_DC )
269+ #else
270+ static ssize_t php_crypto_stream_read (php_stream * stream , char * buf , size_t count TSRMLS_DC )
271+ #endif
260272{
261273 php_crypto_stream_data * data = (php_crypto_stream_data * ) stream -> abstract ;
262274 int bytes_read = BIO_read (data -> bio , buf , count > INT_MAX ? INT_MAX : count );
0 commit comments