@@ -600,7 +600,10 @@ end_dynamic_python3(void)
600
600
py3_runtime_link_init (char * libname , int verbose )
601
601
{
602
602
int i ;
603
- void * ucs_from_string , * ucs_decode , * ucs_as_encoded_string ;
603
+ PYTHON_PROC * ucs_from_string = (PYTHON_PROC * )& py3_PyUnicode_FromString ;
604
+ PYTHON_PROC * ucs_decode = (PYTHON_PROC * )& py3_PyUnicode_Decode ;
605
+ PYTHON_PROC * ucs_as_encoded_string =
606
+ (PYTHON_PROC * )& py3_PyUnicode_AsEncodedString ;
604
607
605
608
# if !(defined(PY_NO_RTLD_GLOBAL ) && defined(PY3_NO_RTLD_GLOBAL )) && defined(UNIX ) && defined(FEAT_PYTHON )
606
609
/* Can't have Python and Python3 loaded at the same time.
@@ -641,33 +644,29 @@ py3_runtime_link_init(char *libname, int verbose)
641
644
/* Load unicode functions separately as only the ucs2 or the ucs4 functions
642
645
* will be present in the library. */
643
646
# if PY_VERSION_HEX >= 0x030300f0
644
- ucs_from_string = symbol_from_dll (hinstPy3 , "PyUnicode_FromString" );
645
- ucs_decode = symbol_from_dll (hinstPy3 , "PyUnicode_Decode" );
646
- ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
647
+ * ucs_from_string = symbol_from_dll (hinstPy3 , "PyUnicode_FromString" );
648
+ * ucs_decode = symbol_from_dll (hinstPy3 , "PyUnicode_Decode" );
649
+ * ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
647
650
"PyUnicode_AsEncodedString" );
648
651
# else
649
- ucs_from_string = symbol_from_dll (hinstPy3 , "PyUnicodeUCS2_FromString" );
650
- ucs_decode = symbol_from_dll (hinstPy3 ,
652
+ * ucs_from_string = symbol_from_dll (hinstPy3 , "PyUnicodeUCS2_FromString" );
653
+ * ucs_decode = symbol_from_dll (hinstPy3 ,
651
654
"PyUnicodeUCS2_Decode" );
652
- ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
655
+ * ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
653
656
"PyUnicodeUCS2_AsEncodedString" );
654
- if (!ucs_from_string || !ucs_decode || !ucs_as_encoded_string )
657
+ if (* ucs_from_string == NULL || * ucs_decode == NULL
658
+ || * ucs_as_encoded_string == NULL )
655
659
{
656
- ucs_from_string = symbol_from_dll (hinstPy3 ,
660
+ * ucs_from_string = symbol_from_dll (hinstPy3 ,
657
661
"PyUnicodeUCS4_FromString" );
658
- ucs_decode = symbol_from_dll (hinstPy3 ,
662
+ * ucs_decode = symbol_from_dll (hinstPy3 ,
659
663
"PyUnicodeUCS4_Decode" );
660
- ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
664
+ * ucs_as_encoded_string = symbol_from_dll (hinstPy3 ,
661
665
"PyUnicodeUCS4_AsEncodedString" );
662
666
}
663
667
# endif
664
- if (ucs_from_string && ucs_decode && ucs_as_encoded_string )
665
- {
666
- py3_PyUnicode_FromString = ucs_from_string ;
667
- py3_PyUnicode_Decode = ucs_decode ;
668
- py3_PyUnicode_AsEncodedString = ucs_as_encoded_string ;
669
- }
670
- else
668
+ if (* ucs_from_string == NULL || * ucs_decode == NULL
669
+ || * ucs_as_encoded_string == NULL )
671
670
{
672
671
close_dll (hinstPy3 );
673
672
hinstPy3 = 0 ;
0 commit comments