diff options
| author | jvoisin | 2024-07-09 15:17:19 +0200 |
|---|---|---|
| committer | jvoisin | 2024-07-09 15:45:22 +0200 |
| commit | 8b85382f29288bd4a8400844934241003e24bb4c (patch) | |
| tree | 3941e1a338b39d164463c43091f1c47563baaafa /src | |
| parent | 1f349eaebdad6e84e32fa32c3511e5a6d3c92110 (diff) | |
Fix compilation for PHP84+
PHP changed some includes for PHP8.4. This commit also adds php8.4-rc to the CI
This fixes #497 and #496
Reported-by: rainerjung
Diffstat (limited to '')
| -rw-r--r-- | src/php_snuffleupagus.h | 10 | ||||
| -rw-r--r-- | src/sp_harden_rand.h | 2 | ||||
| -rw-r--r-- | src/tests/session_encryption/set_custom_session_handler.phpt | 1 | ||||
| -rw-r--r-- | src/tweetnacl.c | 1 |
4 files changed, 11 insertions, 3 deletions
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h index 6e035d4..b4d1be1 100644 --- a/src/php_snuffleupagus.h +++ b/src/php_snuffleupagus.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | #include "ext/standard/php_string.h" | 42 | #include "ext/standard/php_string.h" |
| 43 | #include "ext/standard/php_var.h" | 43 | #include "ext/standard/php_var.h" |
| 44 | #include "ext/session/php_session.h" | 44 | #include "ext/session/php_session.h" |
| 45 | #include "ext/hash/php_hash.h" | ||
| 45 | #include "php.h" | 46 | #include "php.h" |
| 46 | #include "php_ini.h" | 47 | #include "php_ini.h" |
| 47 | #include "rfc1867.h" | 48 | #include "rfc1867.h" |
| @@ -58,9 +59,11 @@ | |||
| 58 | #error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \ | 59 | #error Snuffleupagus only works with PHP7+. You shouldn't use PHP5 anyway, \ |
| 59 | since it's not supported anymore: https://secure.php.net/supported-versions.php | 60 | since it's not supported anymore: https://secure.php.net/supported-versions.php |
| 60 | #endif | 61 | #endif |
| 62 | |||
| 61 | #if PHP_VERSION_ID < 70200 | 63 | #if PHP_VERSION_ID < 70200 |
| 62 | typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS); | 64 | typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS); |
| 63 | #endif | 65 | #endif |
| 66 | |||
| 64 | #if PHP_VERSION_ID >= 80000 | 67 | #if PHP_VERSION_ID >= 80000 |
| 65 | #define TSRMLS_FETCH() | 68 | #define TSRMLS_FETCH() |
| 66 | #define TSRMLS_C | 69 | #define TSRMLS_C |
| @@ -70,6 +73,13 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS); | |||
| 70 | #endif | 73 | #endif |
| 71 | #endif | 74 | #endif |
| 72 | 75 | ||
| 76 | #if PHP_VERSION_ID < 80200 | ||
| 77 | #include "ext/standard/php_rand.h" | ||
| 78 | #include "ext/standard/php_random.h" | ||
| 79 | #else | ||
| 80 | #include "ext/random/php_random.h" | ||
| 81 | #endif | ||
| 82 | |||
| 73 | #define SP_CONFIG_VALID 1 | 83 | #define SP_CONFIG_VALID 1 |
| 74 | #define SP_CONFIG_INVALID 0 | 84 | #define SP_CONFIG_INVALID 0 |
| 75 | #define SP_CONFIG_NONE -1 | 85 | #define SP_CONFIG_NONE -1 |
diff --git a/src/sp_harden_rand.h b/src/sp_harden_rand.h index bbe9be4..0721da0 100644 --- a/src/sp_harden_rand.h +++ b/src/sp_harden_rand.h | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | #ifndef __SP_HARDEN_RAND_H | 1 | #ifndef __SP_HARDEN_RAND_H |
| 2 | #define __SP_HARDEN_RAND_H | 2 | #define __SP_HARDEN_RAND_H |
| 3 | 3 | ||
| 4 | #include "ext/standard/php_rand.h" | ||
| 5 | #include "ext/standard/php_random.h" | ||
| 6 | #include "zend_exceptions.h" | 4 | #include "zend_exceptions.h" |
| 7 | 5 | ||
| 8 | int hook_rand(void); | 6 | int hook_rand(void); |
diff --git a/src/tests/session_encryption/set_custom_session_handler.phpt b/src/tests/session_encryption/set_custom_session_handler.phpt index 04edcd0..1f3f907 100644 --- a/src/tests/session_encryption/set_custom_session_handler.phpt +++ b/src/tests/session_encryption/set_custom_session_handler.phpt | |||
| @@ -3,6 +3,7 @@ Set a custom session handler | |||
| 3 | --SKIPIF-- | 3 | --SKIPIF-- |
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> |
| 5 | <?php if (!extension_loaded("session")) print "skip"; ?> | 5 | <?php if (!extension_loaded("session")) print "skip"; ?> |
| 6 | <?php if (PHP_VERSION_ID >= 80400) print "skip"; /* Calling session_set_save_handler() with more than 2 arguments is deprecated */ ?> | ||
| 6 | --EXTENSIONS-- | 7 | --EXTENSIONS-- |
| 7 | session | 8 | session |
| 8 | --INI-- | 9 | --INI-- |
diff --git a/src/tweetnacl.c b/src/tweetnacl.c index 746cabc..e6d6ed2 100644 --- a/src/tweetnacl.c +++ b/src/tweetnacl.c | |||
| @@ -1,7 +1,6 @@ | |||
| 1 | /* Since TweetNacl doesn't come with a `randombytes` implementation, | 1 | /* Since TweetNacl doesn't come with a `randombytes` implementation, |
| 2 | we're using the one from PHP.*/ | 2 | we're using the one from PHP.*/ |
| 3 | #include "php_snuffleupagus.h" | 3 | #include "php_snuffleupagus.h" |
| 4 | #include "ext/standard/php_random.h" | ||
| 5 | 4 | ||
| 6 | static void randombytes(unsigned char *x, unsigned long long xlen) { | 5 | static void randombytes(unsigned char *x, unsigned long long xlen) { |
| 7 | assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ? | 6 | assert(SIZE_MAX >= ULLONG_MAX); // max(size_t) > max(ull) ? |
