@@ -33,18 +33,12 @@ extern "C" {
33
33
/* {{{ Class Entries */
34
34
zend_class_entry *php_ce_v8object;
35
35
zend_class_entry *php_ce_v8function;
36
-
37
- #ifdef V8JS_V8GENERATOR_SUPPORT
38
36
zend_class_entry *php_ce_v8generator;
39
- #endif
40
37
/* }}} */
41
38
42
39
/* {{{ Object Handlers */
43
40
static zend_object_handlers v8js_v8object_handlers;
44
-
45
- #ifdef V8JS_V8GENERATOR_SUPPORT
46
41
static zend_object_handlers v8js_v8generator_handlers;
47
- #endif
48
42
/* }}} */
49
43
50
44
#define V8JS_V8_INVOKE_FUNC_NAME " V8Js::V8::Invoke"
@@ -483,7 +477,6 @@ PHP_METHOD(V8Function, __wakeup)
483
477
/* }}} */
484
478
485
479
486
- #ifdef V8JS_V8GENERATOR_SUPPORT
487
480
static void v8js_v8generator_free_storage (zend_object *object) /* {{{ */
488
481
{
489
482
v8js_v8generator *c = v8js_v8generator_fetch_object (object);
@@ -662,20 +655,16 @@ PHP_METHOD(V8Generator, valid)
662
655
RETVAL_BOOL (!g->done );
663
656
}
664
657
/* }}} */
665
- #endif /* /V8JS_V8GENERATOR_SUPPORT */
666
658
667
659
668
660
void v8js_v8object_create (zval *res, v8::Handle <v8::Value> value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */
669
661
{
670
662
v8js_ctx *ctx = (v8js_ctx *) isolate->GetData (0 );
671
663
672
- #ifdef V8JS_V8GENERATOR_SUPPORT
673
664
if (value->IsGeneratorObject ()) {
674
665
object_init_ex (res, php_ce_v8generator);
675
666
}
676
- else
677
- #endif /* /V8JS_V8GENERATOR_SUPPORT */
678
- if (value->IsFunction ()) {
667
+ else if (value->IsFunction ()) {
679
668
object_init_ex (res, php_ce_v8function);
680
669
}
681
670
else {
@@ -709,7 +698,6 @@ static const zend_function_entry v8js_v8function_methods[] = { /* {{{ */
709
698
};
710
699
/* }}} */
711
700
712
- #ifdef V8JS_V8GENERATOR_SUPPORT
713
701
ZEND_BEGIN_ARG_INFO (arginfo_v8generator_current, 0 )
714
702
ZEND_END_ARG_INFO()
715
703
@@ -739,7 +727,6 @@ static const zend_function_entry v8js_v8generator_methods[] = { /* {{{ */
739
727
{NULL , NULL , NULL }
740
728
};
741
729
/* }}} */
742
- #endif /* /V8JS_V8GENERATOR_SUPPORT */
743
730
744
731
745
732
PHP_MINIT_FUNCTION (v8js_v8object_class) /* {{{ */
@@ -758,15 +745,13 @@ PHP_MINIT_FUNCTION(v8js_v8object_class) /* {{{ */
758
745
php_ce_v8function->ce_flags |= ZEND_ACC_FINAL;
759
746
php_ce_v8function->create_object = v8js_v8object_new;
760
747
761
- #ifdef V8JS_V8GENERATOR_SUPPORT
762
748
/* V8Generator Class */
763
749
INIT_CLASS_ENTRY (ce, " V8Generator" , v8js_v8generator_methods);
764
750
php_ce_v8generator = zend_register_internal_class (&ce TSRMLS_CC);
765
751
php_ce_v8generator->ce_flags |= ZEND_ACC_FINAL;
766
752
php_ce_v8generator->create_object = v8js_v8generator_new;
767
753
768
754
zend_class_implements (php_ce_v8generator, 1 , zend_ce_iterator);
769
- #endif /* /V8JS_V8GENERATOR_SUPPORT */
770
755
771
756
772
757
/* V8<Object|Function> handlers */
@@ -786,13 +771,11 @@ PHP_MINIT_FUNCTION(v8js_v8object_class) /* {{{ */
786
771
v8js_v8object_handlers.offset = XtOffsetOf (struct v8js_v8object , std);
787
772
v8js_v8object_handlers.free_obj = v8js_v8object_free_storage;
788
773
789
- #ifdef V8JS_V8GENERATOR_SUPPORT
790
774
/* V8Generator handlers */
791
775
memcpy (&v8js_v8generator_handlers, &v8js_v8object_handlers, sizeof (zend_object_handlers));
792
776
v8js_v8generator_handlers.get_method = v8js_v8generator_get_method;
793
777
v8js_v8generator_handlers.offset = XtOffsetOf (struct v8js_v8generator , v8obj.std);
794
778
v8js_v8generator_handlers.free_obj = v8js_v8generator_free_storage;
795
- #endif /* /V8JS_V8GENERATOR_SUPPORT */
796
779
797
780
return SUCCESS;
798
781
} /* }}} */
0 commit comments