Skip to content

Commit e5c9272

Browse files
committed
---
yaml --- r: 2573 b: refs/heads/master c: 387a888 h: refs/heads/master i: 2571: d0b245e v: v3
1 parent 7121f60 commit e5c9272

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b42bb2cff249862d22c89af09a912fbb0a8d8862
2+
refs/heads/master: 387a8888ee338bbe4628640cd4cd72037ac57032

trunk/src/comp/driver/rustc.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,26 +166,31 @@ options:
166166
}
167167

168168
fn get_os(str triple) -> session::os {
169-
if (_str::find(triple, "win32") > 0 ||
170-
_str::find(triple, "mingw32") > 0 ) {
169+
if (_str::find(triple, "win32") >= 0 ||
170+
_str::find(triple, "mingw32") >= 0 ) {
171171
ret session::os_win32;
172-
} else if (_str::find(triple, "darwin") > 0) { ret session::os_macos; }
173-
else if (_str::find(triple, "linux") > 0) { ret session::os_linux; }
172+
} else if (_str::find(triple, "darwin") >= 0) { ret session::os_macos; }
173+
else if (_str::find(triple, "linux") >= 0) { ret session::os_linux; }
174+
else { log_err "Unknown operating system!"; fail; }
174175
}
175176

176177
fn get_arch(str triple) -> session::arch {
177-
if (_str::find(triple, "i386") > 0 ||
178-
_str::find(triple, "i486") > 0 ||
179-
_str::find(triple, "i586") > 0 ||
180-
_str::find(triple, "i686") > 0 ||
181-
_str::find(triple, "i786") > 0 ) {
178+
if (_str::find(triple, "i386") >= 0 ||
179+
_str::find(triple, "i486") >= 0 ||
180+
_str::find(triple, "i586") >= 0 ||
181+
_str::find(triple, "i686") >= 0 ||
182+
_str::find(triple, "i786") >= 0 ) {
182183
ret session::arch_x86;
183-
} else if (_str::find(triple, "x86_64") > 0) {
184+
} else if (_str::find(triple, "x86_64") >= 0) {
184185
ret session::arch_x64;
185-
} else if (_str::find(triple, "arm") > 0 ||
186-
_str::find(triple, "xscale") > 0 ) {
186+
} else if (_str::find(triple, "arm") >= 0 ||
187+
_str::find(triple, "xscale") >= 0 ) {
187188
ret session::arch_arm;
188189
}
190+
else {
191+
log_err ("Unknown architecture! " + triple);
192+
fail;
193+
}
189194
}
190195

191196
fn get_default_sysroot(str binary) -> str {

0 commit comments

Comments
 (0)