static int perl_load_file (char *filename) { #ifdef WIN32 static HMODULE lib = NULL; if (!lib) { lib = LoadLibraryA (PERL_DLL); if (!lib) { if (GetLastError () == ERROR_BAD_EXE_FORMAT) /* http://forum.xchat.org/viewtopic.php?t=3277 */ thread_mbox ("Cannot use this " PERL_DLL "\n\n" "32-bit ActivePerl is required."); else { /* a lot of people install this old version */ lib = LoadLibraryA ("perl56.dll"); if (lib) { FreeLibrary (lib); lib = NULL; thread_mbox ("Cannot open " PERL_DLL "\n\n" "You must have either ActivePerl or Straberry Perl" PERL_REQUIRED_VERSION " installed in order to\n" "run perl scripts.\n\n" "I have found Perl 5.6, but that is too old."); } else { thread_mbox ("Cannot open " PERL_DLL "\n\n" "You must have either ActivePerl or Strawberry Perl " PERL_REQUIRED_VERSION " installed in order to\n" "run perl scripts.\n\n" "http://www.activestate.com/ActivePerl/\n" "http://strawberryperl.com/\n" "Make sure perl's bin directory is in your PATH."); } } /* failure */ return FALSE; } /* success */ FreeLibrary (lib); } #endif if (my_perl == NULL) { perl_init (); } return execute_perl (sv_2mortal (newSVpv ("Xchat::Embed::load", 0)), filename); }
static int perl_load_file (char *filename) { #ifdef WIN32 static HMODULE lib = NULL; if (!lib) { lib = LoadLibraryA (PERL_DLL); if (!lib) { if (GetLastError () == ERROR_BAD_EXE_FORMAT) /* http://forum.xchat.org/viewtopic.php?t=3277 */ thread_mbox ("Cannot use this " PERL_DLL "\n\n" #ifdef _WIN64 "64-bit Strawberry Perl is required."); #else "32-bit Strawberry Perl is required."); #endif else { /* a lot of people install this old version */ lib = LoadLibraryA ("perl56.dll"); if (lib) { FreeLibrary (lib); lib = NULL; thread_mbox ("Cannot open " PERL_DLL "!\n\n" "You must have a Visual C++ build of Perl " PERL_REQUIRED_VERSION " installed in order to\n" "run Perl scripts. A reboot may be required.\n\n" "http://hexchat.github.io/downloads.html\n\n" "I have found Perl 5.6, but that is too old."); } else { thread_mbox ("Cannot open " PERL_DLL "!\n\n" "You must have a Visual C++ build of Perl " PERL_REQUIRED_VERSION " installed in order to\n" "run Perl scripts. A reboot may be required.\n\n" "http://hexchat.github.io/downloads.html\n\n" "Make sure Perl's bin directory is in your PATH."); } } /* failure */ return FALSE; }