Skip to content

Commit 2da3cc4

Browse files
committed
Declare ext/intl constants in stubs - part 8
1 parent d013d94 commit 2da3cc4

8 files changed

+7505
-744
lines changed

ext/intl/uchar/ublockcode-enum.h

-260
This file was deleted.

ext/intl/uchar/uchar.c

+3-40
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#include "uchar.h"
22
#include "intl_data.h"
33
#include "intl_convert.h"
4-
#include "uchar_arginfo.h"
54

65
#include <unicode/uchar.h>
76
#include <unicode/utf8.h>
87

8+
#include "uchar_arginfo.h"
9+
910
#define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)
1011

1112
static inline int convert_cp(UChar32* pcp, zend_string *string_codepoint, zend_long int_codepoint) {
@@ -612,45 +613,7 @@ IC_CHAR_METHOD_CHAR(getBidiPairedBracket)
612613
/* }}} */
613614

614615
int php_uchar_minit(INIT_FUNC_ARGS) {
615-
zend_class_entry *ce;
616-
617-
ce = register_class_IntlChar();
618-
619-
#define IC_CONSTL(name, val) \
620-
zend_declare_class_constant_long(ce, name, strlen(name), val);
621-
622-
zend_declare_class_constant_string(ce, "UNICODE_VERSION", sizeof("UNICODE_VERISON")-1, U_UNICODE_VERSION);
623-
IC_CONSTL("CODEPOINT_MIN", UCHAR_MIN_VALUE)
624-
IC_CONSTL("CODEPOINT_MAX", UCHAR_MAX_VALUE)
625-
zend_declare_class_constant_double(ce, "NO_NUMERIC_VALUE", sizeof("NO_NUMERIC_VALUE")-1, U_NO_NUMERIC_VALUE);
626-
627-
/* All enums used by the uchar APIs. There are a LOT of them,
628-
* so they're separated out into include files,
629-
* leaving this source file for actual implementation.
630-
*/
631-
#define UPROPERTY(name) IC_CONSTL("PROPERTY_" #name, UCHAR_##name)
632-
#include "uproperty-enum.h"
633-
#undef UPROPERTY
634-
635-
#define UCHARCATEGORY(name) IC_CONSTL("CHAR_CATEGORY_" #name, U_##name)
636-
#include "ucharcategory-enum.h"
637-
#undef UCHARCATEGORY
638-
639-
#define UCHARDIRECTION(name) IC_CONSTL("CHAR_DIRECTION_" #name, U_##name)
640-
#include "uchardirection-enum.h"
641-
#undef UCHARDIRECTION
642-
643-
#define UBLOCKCODE(name) IC_CONSTL("BLOCK_CODE_" #name, UBLOCK_##name)
644-
#include "ublockcode-enum.h"
645-
#undef UBLOCKCODE
646-
647-
/* Smaller, self-destribing enums */
648-
#define UOTHER(name) IC_CONSTL(#name, U_##name)
649-
#include "uother-enum.h"
650-
#undef UOTHER
651-
652-
#undef IC_CONSTL
653-
#undef IC_CONSTS
616+
register_class_IntlChar();
654617

655618
return SUCCESS;
656619
}

0 commit comments

Comments
 (0)