Skip to content

Commit 9e9a8be

Browse files
committed
Simplify iconv const patch
1 parent f7aaec2 commit 9e9a8be

File tree

4 files changed

+27
-38
lines changed

4 files changed

+27
-38
lines changed

cmake/ext/iconv/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ if(TARGET Iconv::Iconv)
300300

301301
if(PHP_EXT_ICONV_CONST)
302302
target_compile_definitions(php_ext_iconv PRIVATE ICONV_CONST=const)
303-
else()
304-
target_compile_definitions(php_ext_iconv PRIVATE ICONV_CONST=)
305303
endif()
306304
endif()
307305

patches/8.3/iconv.patch

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,23 @@ See:
66
* https://github.com/php/php-src/pull/18933
77
* https://github.com/php/php-src/pull/16847
88
---
9-
ext/iconv/iconv.c | 2 ++
10-
1 file changed, 2 insertions(+)
9+
ext/iconv/iconv.c | 6 +-----
10+
1 file changed, 1 insertion(+), 5 deletions(-)
1111

1212
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
13-
index 8ac3bc9b3c4..f11b8d74c63 100644
13+
index 8ac3bc9b3c4..307188bc898 100644
1414
--- a/ext/iconv/iconv.c
1515
+++ b/ext/iconv/iconv.c
16-
@@ -44,6 +44,7 @@
16+
@@ -44,11 +44,7 @@
1717
#undef iconv
1818
#endif
1919

20+
-#if defined(__NetBSD__)
21+
-// unfortunately, netbsd has still the old non posix conformant signature
22+
-// libiconv tends to match the eventual system's iconv too.
23+
-#define ICONV_CONST const
24+
-#else
2025
+#ifndef ICONV_CONST
21-
#if defined(__NetBSD__)
22-
// unfortunately, netbsd has still the old non posix conformant signature
23-
// libiconv tends to match the eventual system's iconv too.
24-
@@ -51,6 +52,7 @@
25-
#else
2626
#define ICONV_CONST
2727
#endif
28-
+#endif
2928

30-
#include "zend_smart_str.h"
31-
#include "ext/standard/base64.h"

patches/8.4/iconv.patch

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,23 @@ See:
66
* https://github.com/php/php-src/pull/18933
77
* https://github.com/php/php-src/pull/16847
88
---
9-
ext/iconv/iconv.c | 2 ++
10-
1 file changed, 2 insertions(+)
9+
ext/iconv/iconv.c | 6 +-----
10+
1 file changed, 1 insertion(+), 5 deletions(-)
1111

1212
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
13-
index b61d253c5d4..53423e9ce49 100644
13+
index b61d253c5d4..64cf3e4d5dd 100644
1414
--- a/ext/iconv/iconv.c
1515
+++ b/ext/iconv/iconv.c
16-
@@ -43,6 +43,7 @@
16+
@@ -43,11 +43,7 @@
1717
#undef iconv
1818
#endif
1919

20+
-#if defined(__NetBSD__)
21+
-// unfortunately, netbsd has still the old non posix conformant signature
22+
-// libiconv tends to match the eventual system's iconv too.
23+
-#define ICONV_CONST const
24+
-#else
2025
+#ifndef ICONV_CONST
21-
#if defined(__NetBSD__)
22-
// unfortunately, netbsd has still the old non posix conformant signature
23-
// libiconv tends to match the eventual system's iconv too.
24-
@@ -50,6 +51,7 @@
25-
#else
2626
#define ICONV_CONST
2727
#endif
28-
+#endif
2928

30-
#include "zend_smart_str.h"
31-
#include "ext/standard/base64.h"

patches/8.5/iconv.patch

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,23 @@ See:
66
* https://github.com/php/php-src/pull/18933
77
* https://github.com/php/php-src/pull/16847
88
---
9-
ext/iconv/iconv.c | 2 ++
10-
1 file changed, 2 insertions(+)
9+
ext/iconv/iconv.c | 6 +-----
10+
1 file changed, 1 insertion(+), 5 deletions(-)
1111

1212
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
13-
index 2b19b1e3c78..3837c4b853c 100644
13+
index 2b19b1e3c78..aed1728f943 100644
1414
--- a/ext/iconv/iconv.c
1515
+++ b/ext/iconv/iconv.c
16-
@@ -43,6 +43,7 @@
16+
@@ -43,11 +43,7 @@
1717
#undef iconv
1818
#endif
1919

20+
-#if defined(__NetBSD__) || (defined(__sun) && defined(__SVR4))
21+
-// unfortunately, netbsd has still the old non posix conformant signature
22+
-// libiconv tends to match the eventual system's iconv too.
23+
-#define ICONV_CONST const
24+
-#else
2025
+#ifndef ICONV_CONST
21-
#if defined(__NetBSD__) || (defined(__sun) && defined(__SVR4))
22-
// unfortunately, netbsd has still the old non posix conformant signature
23-
// libiconv tends to match the eventual system's iconv too.
24-
@@ -50,6 +51,7 @@
25-
#else
2626
#define ICONV_CONST
2727
#endif
28-
+#endif
2928

30-
#include "zend_smart_str.h"
31-
#include "ext/standard/base64.h"

0 commit comments

Comments
 (0)