@@ -3397,13 +3397,6 @@ static void get_unlinked_dependency(zend_class_entry *ce, const char **kind, con
3397
3397
* name = ZSTR_VAL (ce -> parent_name );
3398
3398
return ;
3399
3399
}
3400
- #ifdef ZEND_WIN32
3401
- if (p -> type == ZEND_INTERNAL_CLASS ) {
3402
- * kind = "Windows can't link to internal parent " ;
3403
- * name = ZSTR_VAL (ce -> parent_name );
3404
- return ;
3405
- }
3406
- #endif
3407
3400
if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3408
3401
* kind = "Parent with unresolved initializers " ;
3409
3402
* name = ZSTR_VAL (ce -> parent_name );
@@ -3523,13 +3516,6 @@ static zend_bool preload_try_resolve_property_types(zend_class_entry *ce)
3523
3516
continue ;
3524
3517
}
3525
3518
if (p != ce ) {
3526
- #ifdef ZEND_WIN32
3527
- /* On Windows we can't link with internal class, because of ASLR */
3528
- if (p -> type == ZEND_INTERNAL_CLASS ) {
3529
- ok = 0 ;
3530
- continue ;
3531
- }
3532
- #endif
3533
3519
if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3534
3520
ok = 0 ;
3535
3521
continue ;
@@ -3666,10 +3652,6 @@ static void preload_link(void)
3666
3652
parent = zend_hash_find_ptr (EG (class_table ), key );
3667
3653
zend_string_release (key );
3668
3654
if (!parent ) continue ;
3669
- #ifdef ZEND_WIN32
3670
- /* On Windows we can't link with internal class, because of ASLR */
3671
- if (parent -> type == ZEND_INTERNAL_CLASS ) continue ;
3672
- #endif
3673
3655
if (!(parent -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3674
3656
continue ;
3675
3657
}
@@ -3686,13 +3668,6 @@ static void preload_link(void)
3686
3668
found = 0 ;
3687
3669
break ;
3688
3670
}
3689
- #ifdef ZEND_WIN32
3690
- /* On Windows we can't link with internal class, because of ASLR */
3691
- if (p -> type == ZEND_INTERNAL_CLASS ) {
3692
- found = 0 ;
3693
- break ;
3694
- }
3695
- #endif
3696
3671
if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3697
3672
found = 0 ;
3698
3673
break ;
@@ -3709,13 +3684,6 @@ static void preload_link(void)
3709
3684
found = 0 ;
3710
3685
break ;
3711
3686
}
3712
- #ifdef ZEND_WIN32
3713
- /* On Windows we can't link with internal class, because of ASLR */
3714
- if (p -> type == ZEND_INTERNAL_CLASS ) {
3715
- found = 0 ;
3716
- break ;
3717
- }
3718
- #endif
3719
3687
}
3720
3688
if (!found ) continue ;
3721
3689
}
@@ -3859,26 +3827,6 @@ static void preload_link(void)
3859
3827
} ZEND_HASH_FOREACH_END ();
3860
3828
}
3861
3829
3862
- #ifdef ZEND_WIN32
3863
- static void preload_check_windows_restriction (zend_class_entry * scope , zend_class_entry * ce ) {
3864
- if (ce && ce -> type == ZEND_INTERNAL_CLASS ) {
3865
- zend_error_noreturn (E_ERROR ,
3866
- "Class %s uses internal class %s during preloading, which is not supported on Windows" ,
3867
- ZSTR_VAL (scope -> name ), ZSTR_VAL (ce -> name ));
3868
- }
3869
- }
3870
-
3871
- static void preload_check_windows_restrictions (zend_class_entry * scope ) {
3872
- uint32_t i ;
3873
-
3874
- preload_check_windows_restriction (scope , scope -> parent );
3875
-
3876
- for (i = 0 ; i < scope -> num_interfaces ; i ++ ) {
3877
- preload_check_windows_restriction (scope , scope -> interfaces [i ]);
3878
- }
3879
- }
3880
- #endif
3881
-
3882
3830
static inline int preload_update_class_constants (zend_class_entry * ce ) {
3883
3831
/* This is a separate function to work around what appears to be a bug in GCC
3884
3832
* maybe-uninitialized analysis. */
@@ -3931,10 +3879,6 @@ static void preload_ensure_classes_loadable() {
3931
3879
continue ;
3932
3880
}
3933
3881
3934
- #ifdef ZEND_WIN32
3935
- preload_check_windows_restrictions (ce );
3936
- #endif
3937
-
3938
3882
if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
3939
3883
if (preload_update_class_constants (ce ) == FAILURE ) {
3940
3884
zend_error_noreturn (E_ERROR ,
@@ -4601,9 +4545,11 @@ static int accel_finish_startup(void)
4601
4545
}
4602
4546
4603
4547
if (ZCG (accel_directives ).preload && * ZCG (accel_directives ).preload ) {
4604
- #ifndef ZEND_WIN32
4548
+ #ifdef ZEND_WIN32
4549
+ zend_accel_error (ACCEL_LOG_ERROR , "Preloading is not supported on Windows" );
4550
+ return FAILURE ;
4551
+ #else
4605
4552
int in_child = 0 ;
4606
- #endif
4607
4553
int ret = SUCCESS ;
4608
4554
int rc ;
4609
4555
int orig_error_reporting ;
@@ -4637,7 +4583,6 @@ static int accel_finish_startup(void)
4637
4583
return SUCCESS ;
4638
4584
}
4639
4585
4640
- #ifndef ZEND_WIN32
4641
4586
if (geteuid () == 0 ) {
4642
4587
pid_t pid ;
4643
4588
struct passwd * pw ;
@@ -4701,7 +4646,6 @@ static int accel_finish_startup(void)
4701
4646
zend_accel_error (ACCEL_LOG_WARNING , "\"opcache.preload_user\" is ignored" );
4702
4647
}
4703
4648
}
4704
- #endif
4705
4649
4706
4650
sapi_module .activate = NULL ;
4707
4651
sapi_module .deactivate = NULL ;
@@ -4713,11 +4657,9 @@ static int accel_finish_startup(void)
4713
4657
sapi_module .ub_write = preload_ub_write ;
4714
4658
sapi_module .flush = preload_flush ;
4715
4659
4716
- #ifndef ZEND_WIN32
4717
4660
if (in_child ) {
4718
4661
CG (compiler_options ) |= ZEND_COMPILE_PRELOAD_IN_CHILD ;
4719
4662
}
4720
- #endif
4721
4663
CG (compiler_options ) |= ZEND_COMPILE_PRELOAD ;
4722
4664
CG (compiler_options ) |= ZEND_COMPILE_HANDLE_OP_ARRAY ;
4723
4665
CG (compiler_options ) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES ;
@@ -4792,17 +4734,16 @@ static int accel_finish_startup(void)
4792
4734
4793
4735
sapi_activate ();
4794
4736
4795
- #ifndef ZEND_WIN32
4796
4737
if (in_child ) {
4797
4738
if (ret == SUCCESS ) {
4798
4739
exit (0 );
4799
4740
} else {
4800
4741
exit (2 );
4801
4742
}
4802
4743
}
4803
- #endif
4804
4744
4805
4745
return ret ;
4746
+ #endif
4806
4747
}
4807
4748
4808
4749
return SUCCESS ;
0 commit comments