mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
Add empty Generator class
This commit is contained in:
parent
1cec3f12cc
commit
ca59e5464d
@ -17,7 +17,8 @@ libZend_la_SOURCES=\
|
||||
zend_objects_API.c zend_ts_hash.c zend_stream.c \
|
||||
zend_default_classes.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c \
|
||||
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c
|
||||
zend_strtod.c zend_closures.c zend_float.c zend_string.c zend_signal.c \
|
||||
zend_generators.c
|
||||
|
||||
libZend_la_LDFLAGS =
|
||||
libZend_la_LIBADD = @ZEND_EXTRA_LIBS@
|
||||
|
@ -159,6 +159,10 @@ SOURCE=.\zend_float.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -185,6 +185,10 @@ SOURCE=.\zend_extensions.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_generators.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\zend_hash.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "zend_interfaces.h"
|
||||
#include "zend_exceptions.h"
|
||||
#include "zend_closures.h"
|
||||
#include "zend_generators.h"
|
||||
|
||||
|
||||
ZEND_API void zend_register_default_classes(TSRMLS_D)
|
||||
@ -33,6 +34,7 @@ ZEND_API void zend_register_default_classes(TSRMLS_D)
|
||||
zend_register_default_exception(TSRMLS_C);
|
||||
zend_register_iterator_wrapper(TSRMLS_C);
|
||||
zend_register_closure_ce(TSRMLS_C);
|
||||
zend_register_generator_ce(TSRMLS_C);
|
||||
}
|
||||
|
||||
/*
|
||||
|
47
Zend/zend_generators.c
Normal file
47
Zend/zend_generators.c
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Nikita Popov <nikic@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#include "zend.h"
|
||||
#include "zend_API.h"
|
||||
#include "zend_generators.h"
|
||||
|
||||
ZEND_API zend_class_entry *zend_ce_generator;
|
||||
|
||||
static const zend_function_entry generator_functions[] = {
|
||||
ZEND_FE_END
|
||||
};
|
||||
|
||||
void zend_register_generator_ce(TSRMLS_D) /* {{{ */
|
||||
{
|
||||
zend_class_entry ce;
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "Generator", generator_functions);
|
||||
zend_ce_generator = zend_register_internal_class(&ce TSRMLS_CC);
|
||||
zend_ce_generator->ce_flags |= ZEND_ACC_FINAL_CLASS;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*/
|
40
Zend/zend_generators.h
Normal file
40
Zend/zend_generators.h
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
+----------------------------------------------------------------------+
|
||||
| Zend Engine |
|
||||
+----------------------------------------------------------------------+
|
||||
| Copyright (c) 1998-2012 Zend Technologies Ltd. (http://www.zend.com) |
|
||||
+----------------------------------------------------------------------+
|
||||
| This source file is subject to version 2.00 of the Zend license, |
|
||||
| that is bundled with this package in the file LICENSE, and is |
|
||||
| available through the world-wide-web at the following url: |
|
||||
| http://www.zend.com/license/2_00.txt. |
|
||||
| If you did not receive a copy of the Zend license and are unable to |
|
||||
| obtain it through the world-wide-web, please send a note to |
|
||||
| license@zend.com so we can mail you a copy immediately. |
|
||||
+----------------------------------------------------------------------+
|
||||
| Authors: Nikita Popov <nikic@php.net> |
|
||||
+----------------------------------------------------------------------+
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
#ifndef ZEND_GENERATORS_H
|
||||
#define ZEND_GENERATORS_H
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
|
||||
void zend_register_generator_ce(TSRMLS_D);
|
||||
|
||||
extern ZEND_API zend_class_entry *zend_ce_generator;
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
* c-basic-offset: 4
|
||||
* indent-tabs-mode: t
|
||||
* End:
|
||||
*/
|
@ -1472,7 +1472,7 @@ PHP_ADD_SOURCES(Zend, \
|
||||
zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \
|
||||
zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \
|
||||
zend_iterators.c zend_interfaces.c zend_exceptions.c zend_strtod.c zend_gc.c \
|
||||
zend_closures.c zend_float.c zend_string.c zend_signal.c)
|
||||
zend_closures.c zend_float.c zend_string.c zend_signal.c zend_generators.c)
|
||||
|
||||
if test -r "$abs_srcdir/Zend/zend_objects.c"; then
|
||||
PHP_ADD_SOURCES(Zend, zend_objects.c zend_object_handlers.c zend_objects_API.c zend_default_classes.c)
|
||||
|
@ -359,7 +359,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \
|
||||
zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
|
||||
zend_object_handlers.c zend_objects_API.c \
|
||||
zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c zend_closures.c \
|
||||
zend_float.c zend_string.c");
|
||||
zend_float.c zend_string.c zend_generators.c");
|
||||
|
||||
if (VCVERS == 1200) {
|
||||
AC_DEFINE('ZEND_DVAL_TO_LVAL_CAST_OK', 1);
|
||||
|
Loading…
Reference in New Issue
Block a user