Made PerlConsole compilation optional. Added a funny line in autoperl docs.

Originally committed to SVN as r1848.
This commit is contained in:
shb 2008-01-27 01:22:01 +00:00
parent f6a7c5c98a
commit 9a7012de0b
5 changed files with 18 additions and 3 deletions

View file

@ -266,6 +266,7 @@ namespace Automation4 {
XS(perl_console_register)
{
wxTRACE_FUNC(Aegisub::PerlConsole::register_console);
#ifdef WITH_PERLCONSOLE
dXSARGS;
PerlScript *script = PerlScript::GetScript();
@ -283,6 +284,11 @@ namespace Automation4 {
// If there's no registered console
script->AddFeature(new PerlConsole(name, desc, script));
}
XSRETURN_YES;
#else
PerlLogWarning(_("Tried to register PerlConsole, but support for it was disabled in this version.")); // Warning or Hint?
XSRETURN_UNDEF;
#endif
}
XS(perl_console_echo)
@ -299,16 +305,17 @@ namespace Automation4 {
buffer << _T(" ") << wxString(SvPV_nolen(ST(i)), pl2wx);
}
#ifdef WITH_PERLCONSOLE
if(PerlConsole::GetConsole()) {
// If there's a console echo to it
PerlConsole::Echo(buffer);
}
else {
else
#endif
// Otherwise print on stdout
PerlIO_printf(PerlIO_stdout(), "%s\n", buffer.mb_str(wxConvLocal).data());
// (through perl io system)
}
}
/* Universal loader */
EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);

View file

@ -35,6 +35,7 @@
#ifdef WITH_PERL
#ifdef WITH_PERLCONSOLE
#include "auto4_perl.h"
@ -237,4 +238,5 @@ namespace Automation4 {
};
#endif //WITH_PERLCONSOLE
#endif //WITH_PERL

View file

@ -416,6 +416,7 @@ namespace Automation4 {
void PerlFeatureMacro::Process(AssFile *subs, std::vector<int> &selected, int active, wxWindow * const progress_parent)
{
/* TODO: extend the progress window 'coverage' */
// Convert the AssFile::Line to perl stuff
AV *lines = PerlAss::MakeHasshLines(NULL, subs);
// Same with the selection array

View file

@ -106,6 +106,10 @@
// Requires: perl library (ActivePerl comes with one for Visual C++ under lib\core\)
//#define WITH_PERL
// Enable PerlConsole (a debug tool for the perl engine)
// You don't want it
//#define WITH_PERLCONSOLE
///////////// NOT RECOMMENDED /////////////

View file

@ -86,7 +86,8 @@ warn LIST
wxlog LEVEL, LIST
wxlog LIST
Similar to 'log', with LOG_WX flag implicitely set.
Similar to 'log', but with LOG_WX flag implicitely set. This function is
top-secret.
====================================