3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

compiler_vm: do not automatically pull in #include prelude if #include detected in code

This commit is contained in:
Pragmatic Software 2011-01-29 20:50:44 +00:00
parent 3255bdcd93
commit 514484a1e6
2 changed files with 7 additions and 2 deletions

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 279,
BUILD_REVISION => 280,
BUILD_DATE => "2011-01-29",
};

View File

@ -568,7 +568,12 @@ $code =~ s/#include <([^>]+)>/#include <$1>\n/g;
$code =~ s/#([^ ]+) (.*?)\\n/#$1 $2\n/g;
$code =~ s/#([\w\d_]+)\\n/#$1\n/g;
my $precode = $preludes{$lang} . $code;
my $precode;
if($code =~ m/#include/) {
$precode = $code;
} else {
$precode = $preludes{$lang} . $code;
}
$code = '';
if($lang eq 'C' or $lang eq 'C99' or $lang eq 'C++') {