@@ -3397,13 +3397,6 @@ static void get_unlinked_dependency(zend_class_entry *ce, const char **kind, con
33973397 * name = ZSTR_VAL (ce -> parent_name );
33983398 return ;
33993399 }
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
34073400 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
34083401 * kind = "Parent with unresolved initializers " ;
34093402 * name = ZSTR_VAL (ce -> parent_name );
@@ -3523,13 +3516,6 @@ static zend_bool preload_try_resolve_property_types(zend_class_entry *ce)
35233516 continue ;
35243517 }
35253518 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
35333519 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
35343520 ok = 0 ;
35353521 continue ;
@@ -3666,10 +3652,6 @@ static void preload_link(void)
36663652 parent = zend_hash_find_ptr (EG (class_table ), key );
36673653 zend_string_release (key );
36683654 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
36733655 if (!(parent -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
36743656 continue ;
36753657 }
@@ -3686,13 +3668,6 @@ static void preload_link(void)
36863668 found = 0 ;
36873669 break ;
36883670 }
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
36963671 if (!(p -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
36973672 found = 0 ;
36983673 break ;
@@ -3709,13 +3684,6 @@ static void preload_link(void)
37093684 found = 0 ;
37103685 break ;
37113686 }
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
37193687 }
37203688 if (!found ) continue ;
37213689 }
@@ -3859,26 +3827,6 @@ static void preload_link(void)
38593827 } ZEND_HASH_FOREACH_END ();
38603828}
38613829
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-
38823830static inline int preload_update_class_constants (zend_class_entry * ce ) {
38833831 /* This is a separate function to work around what appears to be a bug in GCC
38843832 * maybe-uninitialized analysis. */
@@ -3931,10 +3879,6 @@ static void preload_ensure_classes_loadable() {
39313879 continue ;
39323880 }
39333881
3934- #ifdef ZEND_WIN32
3935- preload_check_windows_restrictions (ce );
3936- #endif
3937-
39383882 if (!(ce -> ce_flags & ZEND_ACC_CONSTANTS_UPDATED )) {
39393883 if (preload_update_class_constants (ce ) == FAILURE ) {
39403884 zend_error_noreturn (E_ERROR ,
@@ -4601,9 +4545,11 @@ static int accel_finish_startup(void)
46014545 }
46024546
46034547 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
46054552 int in_child = 0 ;
4606- #endif
46074553 int ret = SUCCESS ;
46084554 int rc ;
46094555 int orig_error_reporting ;
@@ -4637,7 +4583,6 @@ static int accel_finish_startup(void)
46374583 return SUCCESS ;
46384584 }
46394585
4640- #ifndef ZEND_WIN32
46414586 if (geteuid () == 0 ) {
46424587 pid_t pid ;
46434588 struct passwd * pw ;
@@ -4701,7 +4646,6 @@ static int accel_finish_startup(void)
47014646 zend_accel_error (ACCEL_LOG_WARNING , "\"opcache.preload_user\" is ignored" );
47024647 }
47034648 }
4704- #endif
47054649
47064650 sapi_module .activate = NULL ;
47074651 sapi_module .deactivate = NULL ;
@@ -4713,11 +4657,9 @@ static int accel_finish_startup(void)
47134657 sapi_module .ub_write = preload_ub_write ;
47144658 sapi_module .flush = preload_flush ;
47154659
4716- #ifndef ZEND_WIN32
47174660 if (in_child ) {
47184661 CG (compiler_options ) |= ZEND_COMPILE_PRELOAD_IN_CHILD ;
47194662 }
4720- #endif
47214663 CG (compiler_options ) |= ZEND_COMPILE_PRELOAD ;
47224664 CG (compiler_options ) |= ZEND_COMPILE_HANDLE_OP_ARRAY ;
47234665 CG (compiler_options ) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES ;
@@ -4792,17 +4734,16 @@ static int accel_finish_startup(void)
47924734
47934735 sapi_activate ();
47944736
4795- #ifndef ZEND_WIN32
47964737 if (in_child ) {
47974738 if (ret == SUCCESS ) {
47984739 exit (0 );
47994740 } else {
48004741 exit (2 );
48014742 }
48024743 }
4803- #endif
48044744
48054745 return ret ;
4746+ #endif
48064747 }
48074748
48084749 return SUCCESS ;
0 commit comments