Skip to content

ext/intl: convert C part to C++ step 1. #19231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ext/intl/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ if test "$PHP_INTL" != "no"; then
formatter/formatter_parse.c
grapheme/grapheme_string.c
grapheme/grapheme_util.c
idn/idn.c
intl_convert.c
intl_error.c
locale/locale_class.c
locale/locale_methods.c
locale/locale.c
listformatter/listformatter_class.c
msgformat/msgformat_attr.c
msgformat/msgformat_class.c
Expand All @@ -57,7 +53,6 @@ if test "$PHP_INTL" != "no"; then
spoofchecker/spoofchecker_main.c
transliterator/transliterator_class.c
transliterator/transliterator_methods.c
uchar/uchar.c
]),
[$ext_shared],,
[$INTL_COMMON_FLAGS],
Expand All @@ -83,7 +78,12 @@ if test "$PHP_INTL" != "no"; then
breakiterator/breakiterator_methods.cpp \
breakiterator/rulebasedbreakiterator_methods.cpp \
breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp"
breakiterator/codepointiterator_methods.cpp \
idn/idn.cpp \
locale/locale_class.cpp \
locale/locale_methods.cpp \
locale/locale.cpp \
uchar/uchar.cpp"

PHP_REQUIRE_CXX()

Expand Down
10 changes: 5 additions & 5 deletions ext/intl/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ if (PHP_INTL != "no") {
listformatter_class.c \
", "intl");
ADD_SOURCES(configure_module_dirname + "/locale", "\
locale.c \
locale_class.c \
locale_methods.c \
locale.cpp \
locale_class.cpp \
locale_methods.cpp \
", "intl");
ADD_SOURCES(configure_module_dirname + "/msgformat", "\
msgformat.c \
Expand Down Expand Up @@ -78,10 +78,10 @@ if (PHP_INTL != "no") {
datepatterngenerator_methods.cpp \
", "intl");
ADD_SOURCES(configure_module_dirname + "/uchar", "\
uchar.c",
uchar.cpp",
"intl");
ADD_SOURCES(configure_module_dirname + "/idn", "\
idn.c",
idn.cpp",
"intl");
ADD_SOURCES(configure_module_dirname + "/resourcebundle", "\
resourcebundle.c \
Expand Down
7 changes: 5 additions & 2 deletions ext/intl/idn/idn.c → ext/intl/idn/idn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
#include <unicode/ustring.h>

#include "idn.h"

extern "C" {
#include "intl_error.h"
}
/* }}} */

enum {
Expand Down Expand Up @@ -145,15 +148,15 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
}

/* {{{ Converts an Unicode domain to ASCII representation, as defined in the IDNA RFC */
PHP_FUNCTION(idn_to_ascii)
U_CFUNC PHP_FUNCTION(idn_to_ascii)
{
php_intl_idn_handoff(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTL_IDN_TO_ASCII);
}
/* }}} */


/* {{{ Converts an ASCII representation of the domain to Unicode (UTF-8), as defined in the IDNA RFC */
PHP_FUNCTION(idn_to_utf8)
U_CFUNC PHP_FUNCTION(idn_to_utf8)
{
php_intl_idn_handoff(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTL_IDN_TO_UTF8);
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
*/

#include <unicode/uloc.h>
extern "C" {
#include "php_intl.h"
#include "intl_error.h"
#include "locale_class.h"
#include "locale.h"
#include "locale_arginfo.h"
}

zend_class_entry *Locale_ce_ptr = NULL;

Expand All @@ -28,7 +30,7 @@ zend_class_entry *Locale_ce_ptr = NULL;
/* {{{ locale_register_Locale_class
* Initialize 'Locale' class
*/
void locale_register_Locale_class( void )
U_CFUNC void locale_register_Locale_class( void )
{
/* Create and register 'Locale' class. */
Locale_ce_ptr = register_class_Locale();
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/locale/locale_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ typedef struct {
} Locale_object;


void locale_register_Locale_class( void );
U_CFUNC void locale_register_Locale_class( void );

extern zend_class_entry *Locale_ce_ptr;

Expand Down
Loading
Loading