Skip to content

Declare ext/intl constants in stubs - part 8 #9275

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

Merged
merged 1 commit into from
Aug 9, 2022
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
260 changes: 0 additions & 260 deletions ext/intl/uchar/ublockcode-enum.h

This file was deleted.

43 changes: 3 additions & 40 deletions ext/intl/uchar/uchar.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include "uchar.h"
#include "intl_data.h"
#include "intl_convert.h"
#include "uchar_arginfo.h"

#include <unicode/uchar.h>
#include <unicode/utf8.h>

#include "uchar_arginfo.h"

#define IC_METHOD(mname) PHP_METHOD(IntlChar, mname)

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

int php_uchar_minit(INIT_FUNC_ARGS) {
zend_class_entry *ce;

ce = register_class_IntlChar();

#define IC_CONSTL(name, val) \
zend_declare_class_constant_long(ce, name, strlen(name), val);

zend_declare_class_constant_string(ce, "UNICODE_VERSION", sizeof("UNICODE_VERISON")-1, U_UNICODE_VERSION);
IC_CONSTL("CODEPOINT_MIN", UCHAR_MIN_VALUE)
IC_CONSTL("CODEPOINT_MAX", UCHAR_MAX_VALUE)
zend_declare_class_constant_double(ce, "NO_NUMERIC_VALUE", sizeof("NO_NUMERIC_VALUE")-1, U_NO_NUMERIC_VALUE);

/* All enums used by the uchar APIs. There are a LOT of them,
* so they're separated out into include files,
* leaving this source file for actual implementation.
*/
#define UPROPERTY(name) IC_CONSTL("PROPERTY_" #name, UCHAR_##name)
#include "uproperty-enum.h"
#undef UPROPERTY

#define UCHARCATEGORY(name) IC_CONSTL("CHAR_CATEGORY_" #name, U_##name)
#include "ucharcategory-enum.h"
#undef UCHARCATEGORY

#define UCHARDIRECTION(name) IC_CONSTL("CHAR_DIRECTION_" #name, U_##name)
#include "uchardirection-enum.h"
#undef UCHARDIRECTION

#define UBLOCKCODE(name) IC_CONSTL("BLOCK_CODE_" #name, UBLOCK_##name)
#include "ublockcode-enum.h"
#undef UBLOCKCODE

/* Smaller, self-destribing enums */
#define UOTHER(name) IC_CONSTL(#name, U_##name)
#include "uother-enum.h"
#undef UOTHER

#undef IC_CONSTL
#undef IC_CONSTS
register_class_IntlChar();

return SUCCESS;
}
Loading