Description:
fixed c++ compilation bug (thanks to Witchakorn Kamolpornwijit)
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r119:01b9b35be113 - - 1 file changed: 4 inserted, 1 deleted
@@ -68,33 +68,36 | |||
|
68 | 68 | FileUtils.rm(params[:message_file]) |
|
69 | 69 | end |
|
70 | 70 | |
|
71 | 71 | # Check if the source file exists before attempt compiling. |
|
72 | 72 | if !FileTest.exists? params[:source_file] |
|
73 | 73 | talk("ERROR: The source file does not exist!") |
|
74 | 74 | open(params[:message_file],"w") do |f| |
|
75 | 75 | f.puts "ERROR: The source file did not exist." |
|
76 | 76 | end |
|
77 | 77 | exit(127) |
|
78 | 78 | end |
|
79 | 79 | |
|
80 | + if params[:prog_lang]=='cpp': | |
|
81 | + params[:prog_lang] = 'c++' | |
|
82 | + end | |
|
83 | + | |
|
80 | 84 | # Compile. |
|
81 | 85 | case params[:prog_lang] |
|
82 | 86 | |
|
83 | 87 | when "c" |
|
84 | 88 | command = "#{C_COMPILER} #{params[:source_file]} -o #{params[:output_file]} #{C_OPTIONS} 2> #{params[:message_file]}" |
|
85 | 89 | system(command) |
|
86 | 90 | |
|
87 | 91 | when "c++" |
|
88 | - when "cpp" | |
|
89 | 92 | command = "#{CPLUSPLUS_COMPILER} #{params[:source_file]} -o #{params[:output_file]} #{CPLUSPLUS_OPTIONS} 2> #{params[:message_file]}" |
|
90 | 93 | system(command) |
|
91 | 94 | |
|
92 | 95 | when "pas" |
|
93 | 96 | command = "#{PASCAL_COMPILER} #{params[:source_file]} -ooutpas #{PASCAL_OPTIONS} > #{params[:message_file]}" |
|
94 | 97 | system(command) |
|
95 | 98 | FileUtils.mv("output", params[:output_file]) |
|
96 | 99 | |
|
97 | 100 | else |
|
98 | 101 | talk("ERROR: Invalid language specified!") |
|
99 | 102 | open(params[:message_file],"w") do |f| |
|
100 | 103 | f.puts "ERROR: Invalid language specified!" |
You need to be logged in to leave comments.
Login now