Skip to content
Merged
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
4 changes: 2 additions & 2 deletions ext/intl/breakiterator/breakiterator_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

#include <typeinfo>

extern "C" {
#define USE_BREAKITERATOR_POINTER 1
#include "breakiterator_class.h"
BEGIN_EXTERN_C()
#include "breakiterator_arginfo.h"
END_EXTERN_C()
#include <zend_exceptions.h>
#include <zend_interfaces.h>
#include <assert.h>
}

using PHP::CodePointBreakIterator;
using icu::RuleBasedBreakIterator;
Expand Down
2 changes: 2 additions & 0 deletions ext/intl/breakiterator/breakiterator_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typedef struct {
RETURN_THROWS(); \
}

BEGIN_EXTERN_C()
void breakiterator_object_create(zval *object, BreakIterator *break_iter, int brand_new);

void breakiterator_register_BreakIterator_class(void);
Expand All @@ -70,5 +71,6 @@ extern zend_class_entry *BreakIterator_ce_ptr,
*RuleBasedBreakIterator_ce_ptr;

extern zend_object_handlers BreakIterator_handlers;
END_EXTERN_C()

#endif /* #ifndef BREAKITERATOR_CLASS_H */
4 changes: 2 additions & 2 deletions ext/intl/breakiterator/breakiterator_iterators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
#include "breakiterator_iterators.h"
#include "../common/common_enum.h"

extern "C" {
#define USE_BREAKITERATOR_POINTER
#include "breakiterator_class.h"
BEGIN_EXTERN_C()
#include "breakiterator_iterators_arginfo.h"
END_EXTERN_C()
#include "../intl_convert.h"
#include "../locale/locale.h"
#include <zend_exceptions.h>
#include <zend_interfaces.h>
}

static zend_class_entry *IntlPartsIterator_ce_ptr;

Expand Down
2 changes: 0 additions & 2 deletions ext/intl/breakiterator/breakiterator_iterators.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

#include <unicode/umachine.h>

U_CDECL_BEGIN
#include <math.h>
#include <php.h>
U_CDECL_END

typedef enum {
PARTS_ITERATOR_KEY_SEQUENTIAL,
Expand Down
2 changes: 0 additions & 2 deletions ext/intl/breakiterator/breakiterator_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@

#include "breakiterator_iterators.h"

extern "C" {
#include "../php_intl.h"
#define USE_BREAKITERATOR_POINTER 1
#include "breakiterator_class.h"
#include "../locale/locale.h"
#include <zend_exceptions.h>
#include <zend_interfaces.h>
}

using PHP::CodePointBreakIterator;
using icu::BreakIterator;
Expand Down
2 changes: 0 additions & 2 deletions ext/intl/breakiterator/codepointiterator_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

#include "codepointiterator_internal.h"

extern "C" {
#define USE_BREAKITERATOR_POINTER 1
#include "breakiterator_class.h"
}

using PHP::CodePointBreakIterator;

Expand Down
2 changes: 0 additions & 2 deletions ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
#include <unicode/rbbi.h>
#include <memory>

extern "C" {
#define USE_BREAKITERATOR_POINTER 1
#include "breakiterator_class.h"
#include <zend_exceptions.h>
#include <limits.h>
}

#include "../intl_convertcpp.h"
#include "../intl_common.h"
Expand Down
10 changes: 5 additions & 5 deletions ext/intl/calendar/calendar_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
#include <unicode/calendar.h>
#include <unicode/gregocal.h>

extern "C" {
#define USE_TIMEZONE_POINTER 1
#include "../timezone/timezone_class.h"
#define USE_CALENDAR_POINTER 1
#include "calendar_class.h"
BEGIN_EXTERN_C()
#include "calendar_arginfo.h"
END_EXTERN_C()
#include <zend_exceptions.h>
#include <assert.h>
}

using icu::GregorianCalendar;
using icu::Locale;
Expand All @@ -40,7 +40,7 @@ zend_class_entry *GregorianCalendar_ce_ptr;
zend_object_handlers Calendar_handlers;
/* }}} */

U_CFUNC void calendar_object_create(zval *object,
void calendar_object_create(zval *object,
Calendar *calendar)
{
UClassID classId = calendar->getDynamicClassID();
Expand All @@ -57,14 +57,14 @@ U_CFUNC void calendar_object_create(zval *object,
calendar_object_construct(object, calendar);
}

U_CFUNC Calendar *calendar_fetch_native_calendar(zend_object *object)
Calendar *calendar_fetch_native_calendar(zend_object *object)
{
Calendar_object *co = php_intl_calendar_fetch_object(object);

return co->ucal;
}

U_CFUNC void calendar_object_construct(zval *object,
void calendar_object_construct(zval *object,
Calendar *calendar)
{
Calendar_object *co;
Expand Down
2 changes: 2 additions & 0 deletions ext/intl/calendar/calendar_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ Calendar *calendar_fetch_native_calendar(zend_object *object);

void calendar_object_construct(zval *object, Calendar *calendar);

BEGIN_EXTERN_C()
void calendar_register_IntlCalendar_class(void);

extern zend_class_entry *Calendar_ce_ptr, *GregorianCalendar_ce_ptr;

extern zend_object_handlers Calendar_handlers;
END_EXTERN_C()

#endif /* #ifndef CALENDAR_CLASS_H */
4 changes: 2 additions & 2 deletions ext/intl/calendar/calendar_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "../intl_convertcpp.h"
#include "../common/common_date.h"

extern "C" {
#include "../php_intl.h"
#define USE_TIMEZONE_POINTER 1
#include "../timezone/timezone_class.h"
Expand All @@ -36,8 +35,9 @@ extern "C" {
#include "../intl_convert.h"
#include <zend_exceptions.h>
#include <zend_interfaces.h>
BEGIN_EXTERN_C()
#include <ext/date/php_date.h>
}
END_EXTERN_C()
#include "../common/common_enum.h"

using icu::Locale;
Expand Down
4 changes: 2 additions & 2 deletions ext/intl/calendar/gregoriancalendar_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
#include <unicode/gregocal.h>
#include <unicode/ustring.h>

extern "C" {
#include "../php_intl.h"
#include "../intl_common.h"
#define USE_TIMEZONE_POINTER 1
#include "../timezone/timezone_class.h"
#define USE_CALENDAR_POINTER 1
#include "calendar_class.h"
BEGIN_EXTERN_C()
#include <ext/date/php_date.h>
END_EXTERN_C()
#include "zend_exceptions.h"
}

using icu::GregorianCalendar;
using icu::Locale;
Expand Down
2 changes: 0 additions & 2 deletions ext/intl/collator/collator_attr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
#include <unicode/unistr.h>
#endif

extern "C" {
#include "php_intl.h"
}
#include "collator_class.h"
#include "collator_convert.h"

Expand Down
5 changes: 3 additions & 2 deletions ext/intl/collator/collator_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@

#include "collator.h"
#include "collator_class.h"
extern "C" {
#include "php_intl.h"
#include "intl_error.h"

BEGIN_EXTERN_C()
#include "collator_arginfo.h"
}
END_EXTERN_C()
#include "collator_sort.h"
#include "collator_convert.h"

Expand Down
15 changes: 2 additions & 13 deletions ext/intl/collator/collator_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@

#include <php.h>

#ifdef __cplusplus
extern "C" {
#endif
#include "../intl_common.h"
#include "../intl_error.h"
#include "../intl_data.h"
#ifdef __cplusplus
}
#endif

#include <unicode/ucol.h>

Expand Down Expand Up @@ -64,17 +58,12 @@ static zend_always_inline zend_result collator_check_initialized(Collator_object

return SUCCESS;
}

#ifdef __cplusplus
extern "C" {
#endif
BEGIN_EXTERN_C()
void collator_register_Collator_symbols(int module_number);
void collator_object_destroy( Collator_object* co );
#ifdef __cplusplus
}
#endif

extern zend_class_entry *Collator_ce_ptr;
END_EXTERN_C()

/* Auxiliary macros */

Expand Down
2 changes: 0 additions & 2 deletions ext/intl/collator/collator_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#include <unicode/unistr.h>
#endif

extern "C" {
#include "php_intl.h"
#include "intl_convert.h"
}
#include "collator_class.h"

/* {{{ Compare two strings. */
Expand Down
22 changes: 10 additions & 12 deletions ext/intl/collator/collator_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#include <unicode/unistr.h>
#endif

extern "C" {
#include "php_intl.h"
#include "intl_convert.h"
}
#include "collator_class.h"
#include "collator_is_numeric.h"
#include "collator_convert.h"
Expand Down Expand Up @@ -127,7 +125,7 @@ static void collator_convert_hash_item_from_utf16_to_utf8(
/* {{{ collator_convert_hash_from_utf8_to_utf16
* Convert values of the given hash from UTF-8 encoding to UTF-16LE.
*/
U_CFUNC void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status )
void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status )
{
zend_ulong hashIndex;
zval *hashData;
Expand All @@ -146,7 +144,7 @@ U_CFUNC void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCo
/* {{{ collator_convert_hash_from_utf16_to_utf8
* Convert values of the given hash from UTF-16LE encoding to UTF-8.
*/
U_CFUNC void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status )
void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status )
{
zend_ulong hashIndex;
zend_string *hashKey;
Expand All @@ -171,7 +169,7 @@ U_CFUNC void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCo
*
* @return zval* Converted string.
*/
U_CFUNC zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv )
zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv )
{
zend_string* u8str;
UErrorCode status = U_ZERO_ERROR;
Expand All @@ -190,7 +188,7 @@ U_CFUNC zval* collator_convert_zstr_utf16_to_utf8( zval* utf16_zval, zval *rv )
}
/* }}} */

U_CFUNC zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str)
zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str)
{
UErrorCode status = U_ZERO_ERROR;

Expand All @@ -209,7 +207,7 @@ U_CFUNC zend_string *collator_convert_zstr_utf8_to_utf16(zend_string *utf8_str)
/* {{{ collator_convert_object_to_string
* Convert object to UTF16-encoded string.
*/
U_CFUNC zval* collator_convert_object_to_string( zval* obj, zval *rv )
zval* collator_convert_object_to_string( zval* obj, zval *rv )
{
zval* zstr = nullptr;
UErrorCode status = U_ZERO_ERROR;
Expand Down Expand Up @@ -272,7 +270,7 @@ U_CFUNC zval* collator_convert_object_to_string( zval* obj, zval *rv )
*
* @return zval* Number. If str is not numeric string return number zero.
*/
U_CFUNC zval* collator_convert_string_to_number( zval* str, zval *rv )
zval* collator_convert_string_to_number( zval* str, zval *rv )
{
zval* num = collator_convert_string_to_number_if_possible( str, rv );
if( num == str )
Expand All @@ -296,7 +294,7 @@ U_CFUNC zval* collator_convert_string_to_number( zval* str, zval *rv )
*
* @return zval* Number. If str is not numeric string return number zero.
*/
U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv )
zval* collator_convert_string_to_double( zval* str, zval *rv )
{
zval* num = collator_convert_string_to_number( str, rv );
if( Z_TYPE_P(num) == IS_LONG )
Expand All @@ -317,7 +315,7 @@ U_CFUNC zval* collator_convert_string_to_double( zval* str, zval *rv )
* @return zval* Number if str is numeric string. Otherwise
* original str param.
*/
U_CFUNC zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv )
zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv )
{
uint8_t is_numeric = 0;
zend_long lval = 0;
Expand Down Expand Up @@ -351,7 +349,7 @@ U_CFUNC zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv
*
* @return zend_string* UTF16 string.
*/
U_CFUNC zend_string *collator_zval_to_string(zval *arg)
zend_string *collator_zval_to_string(zval *arg)
{
// TODO: This is extremely weird in that it leaves pre-existing strings alone and does not
// perform a UTF-8 to UTF-16 conversion for them. The assumption is that values that are
Expand Down Expand Up @@ -379,7 +377,7 @@ U_CFUNC zend_string *collator_zval_to_string(zval *arg)
* @return zval* Normalized copy of arg or unmodified arg
* if normalization is not needed.
*/
U_CFUNC zval* collator_normalize_sort_argument( zval* arg, zval *rv )
zval* collator_normalize_sort_argument( zval* arg, zval *rv )
{
zval* n_arg = nullptr;

Expand Down
6 changes: 0 additions & 6 deletions ext/intl/collator/collator_convert.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <php.h>
#include <unicode/utypes.h>

#ifdef __cplusplus
extern "C" {
#endif
void collator_convert_hash_from_utf8_to_utf16( HashTable* hash, UErrorCode* status );
void collator_convert_hash_from_utf16_to_utf8( HashTable* hash, UErrorCode* status );

Expand All @@ -35,8 +32,5 @@ zval* collator_convert_string_to_number_if_possible( zval* str, zval *rv );
zval* collator_convert_string_to_double( zval* str, zval *rv );

zend_string *collator_zval_to_string(zval *arg);
#ifdef __cplusplus
}
#endif

#endif // COLLATOR_CONVERT_H
2 changes: 0 additions & 2 deletions ext/intl/collator/collator_create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
#include <unicode/unistr.h>
#endif

extern "C" {
#include "php_intl.h"
}
#include "collator_class.h"
#include "intl_data.h"

Expand Down
Loading
Loading