Skip to content

Commit 67cc3ed

Browse files
committed
RETURN_STR macro closes #6 closes #8
1 parent eb7ce61 commit 67cc3ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hello/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const PHP_HELLO_VERSION: &str = "0.1.0";
1414
// zend_execute_data *execute_data, zval *return_value
1515
fn zif_confirm_hello_compiled(execute_data: *mut c_void, return_value: *mut _zval_struct) { // void
1616
let strg = strpprintf(0, "Congratulations! You have successfully modified ext/hello/config.m4. Module hello is now compiled into PHP.");
17-
RETURN_STR!(strg)
17+
RETURN_STR!(return_value, strg)
1818
}
1919

2020
static mut hello_module_entry: _zend_module_entry =

src/zend/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ pub fn strpprintf(max_len: libc::size_t, format: &str) -> *mut _zend_string {
161161

162162
#[macro_export]
163163
macro_rules! RETURN_STR {
164-
( $strg:expr ) => {
164+
( $return_value:expr, $strg:expr ) => {
165165
{
166166
unsafe {
167-
(*return_value).value.str = $strg; // RETURN_STR
168-
(*return_value).u1.type_info = IS_STRING_EX;
167+
(*$return_value).value.str = $strg; // RETURN_STR
168+
(*$return_value).u1.type_info = IS_STRING_EX;
169169
}
170170
}
171171
};

0 commit comments

Comments
 (0)