@@ -3389,13 +3389,6 @@ static void get_unlinked_dependency(zend_class_entry *ce, const char **kind, con
33893389 * name = ZSTR_VAL (ce -> parent_name );
33903390 return ;
33913391 }
3392- #ifdef ZEND_WIN32
3393- if (p -> type == ZEND_INTERNAL_CLASS ) {
3394- * kind = "Windows can't link to internal parent " ;
3395- * name = ZSTR_VAL (ce -> parent_name );
3396- return ;
3397- }
3398- #endif
33993392 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
34003393 * kind = "Parent with unresolved initializers " ;
34013394 * name = ZSTR_VAL (ce -> parent_name );
@@ -3515,13 +3508,6 @@ static zend_bool preload_try_resolve_property_types(zend_class_entry *ce)
35153508 continue ;
35163509 }
35173510 if (p != ce ) {
3518- #ifdef ZEND_WIN32
3519- /* On Windows we can't link with internal class, because of ASLR */
3520- if (p -> type == ZEND_INTERNAL_CLASS ) {
3521- ok = 0 ;
3522- continue ;
3523- }
3524- #endif
35253511 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
35263512 ok = 0 ;
35273513 continue ;
@@ -3658,10 +3644,6 @@ static void preload_link(void)
36583644 parent = zend_hash_find_ptr (EG (class_table ), key );
36593645 zend_string_release (key );
36603646 if (!parent ) continue ;
3661- #ifdef ZEND_WIN32
3662- /* On Windows we can't link with internal class, because of ASLR */
3663- if (parent -> type == ZEND_INTERNAL_CLASS ) continue ;
3664- #endif
36653647 if (!(parent -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
36663648 continue ;
36673649 }
@@ -3678,13 +3660,6 @@ static void preload_link(void)
36783660 found = 0 ;
36793661 break ;
36803662 }
3681- #ifdef ZEND_WIN32
3682- /* On Windows we can't link with internal class, because of ASLR */
3683- if (p -> type == ZEND_INTERNAL_CLASS ) {
3684- found = 0 ;
3685- break ;
3686- }
3687- #endif
36883663 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
36893664 found = 0 ;
36903665 break ;
@@ -3701,13 +3676,6 @@ static void preload_link(void)
37013676 found = 0 ;
37023677 break ;
37033678 }
3704- #ifdef ZEND_WIN32
3705- /* On Windows we can't link with internal class, because of ASLR */
3706- if (p -> type == ZEND_INTERNAL_CLASS ) {
3707- found = 0 ;
3708- break ;
3709- }
3710- #endif
37113679 }
37123680 if (!found ) continue ;
37133681 }
@@ -3850,26 +3818,6 @@ static void preload_link(void)
38503818 } ZEND_HASH_FOREACH_END ();
38513819}
38523820
3853- #ifdef ZEND_WIN32
3854- static void preload_check_windows_restriction (zend_class_entry * scope , zend_class_entry * ce ) {
3855- if (ce && ce -> type == ZEND_INTERNAL_CLASS ) {
3856- zend_error_noreturn (E_ERROR ,
3857- "Class %s uses internal class %s during preloading, which is not supported on Windows" ,
3858- ZSTR_VAL (scope -> name ), ZSTR_VAL (ce -> name ));
3859- }
3860- }
3861-
3862- static void preload_check_windows_restrictions (zend_class_entry * scope ) {
3863- uint32_t i ;
3864-
3865- preload_check_windows_restriction (scope , scope -> parent );
3866-
3867- for (i = 0 ; i < scope -> num_interfaces ; i ++ ) {
3868- preload_check_windows_restriction (scope , scope -> interfaces [i ]);
3869- }
3870- }
3871- #endif
3872-
38733821static inline int preload_update_class_constants (zend_class_entry * ce ) {
38743822 /* This is a separate function to work around what appears to be a bug in GCC
38753823 * maybe-uninitialized analysis. */
@@ -3919,10 +3867,6 @@ static void preload_ensure_classes_loadable() {
39193867 continue ;
39203868 }
39213869
3922- #ifdef ZEND_WIN32
3923- preload_check_windows_restrictions (ce );
3924- #endif
3925-
39263870 if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
39273871 if (preload_update_class_constants (ce ) == FAILURE ) {
39283872 zend_error_noreturn (E_ERROR ,
@@ -4589,9 +4533,11 @@ static int accel_finish_startup(void)
45894533 }
45904534
45914535 if (ZCG (accel_directives ).preload && * ZCG (accel_directives ).preload ) {
4592- #ifndef ZEND_WIN32
4536+ #ifdef ZEND_WIN32
4537+ zend_accel_error (ACCEL_LOG_ERROR , "Preloading is not supported on Windows" );
4538+ return FAILURE ;
4539+ #else
45934540 int in_child = 0 ;
4594- #endif
45954541 int ret = SUCCESS ;
45964542 int rc ;
45974543 int orig_error_reporting ;
@@ -4625,7 +4571,6 @@ static int accel_finish_startup(void)
46254571 return SUCCESS ;
46264572 }
46274573
4628- #ifndef ZEND_WIN32
46294574 if (geteuid () == 0 ) {
46304575 pid_t pid ;
46314576 struct passwd * pw ;
@@ -4689,7 +4634,6 @@ static int accel_finish_startup(void)
46894634 zend_accel_error (ACCEL_LOG_WARNING , "\"opcache.preload_user\" is ignored" );
46904635 }
46914636 }
4692- #endif
46934637
46944638 sapi_module .activate = NULL ;
46954639 sapi_module .deactivate = NULL ;
@@ -4701,11 +4645,9 @@ static int accel_finish_startup(void)
47014645 sapi_module .ub_write = preload_ub_write ;
47024646 sapi_module .flush = preload_flush ;
47034647
4704- #ifndef ZEND_WIN32
47054648 if (in_child ) {
47064649 CG (compiler_options ) |= ZEND_COMPILE_PRELOAD_IN_CHILD ;
47074650 }
4708- #endif
47094651 CG (compiler_options ) |= ZEND_COMPILE_PRELOAD ;
47104652 CG (compiler_options ) |= ZEND_COMPILE_HANDLE_OP_ARRAY ;
47114653 CG (compiler_options ) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES ;
@@ -4780,17 +4722,16 @@ static int accel_finish_startup(void)
47804722
47814723 sapi_activate ();
47824724
4783- #ifndef ZEND_WIN32
47844725 if (in_child ) {
47854726 if (ret == SUCCESS ) {
47864727 exit (0 );
47874728 } else {
47884729 exit (2 );
47894730 }
47904731 }
4791- #endif
47924732
47934733 return ret ;
4734+ #endif
47944735 }
47954736
47964737 return SUCCESS ;
0 commit comments