string literals have type *const u8

This commit is contained in:
Josh Wolfe
2015-12-01 14:41:03 -07:00
parent ab327344b6
commit c6a9ab107b
6 changed files with 56 additions and 38 deletions

View File

@@ -99,7 +99,7 @@ static void add_compiling_test_cases(void) {
add_simple_case("hello world with libc", R"SOURCE(
#link("c")
extern {
fn puts(s: *mut u8) -> i32;
fn puts(s: *const u8) -> i32;
fn exit(code: i32) -> unreachable;
}
@@ -112,7 +112,7 @@ static void add_compiling_test_cases(void) {
add_simple_case("function call", R"SOURCE(
#link("c")
extern {
fn puts(s: *mut u8) -> i32;
fn puts(s: *const u8) -> i32;
fn exit(code: i32) -> unreachable;
}
@@ -134,7 +134,7 @@ static void add_compiling_test_cases(void) {
add_simple_case("comments", R"SOURCE(
#link("c")
extern {
fn puts(s: *mut u8) -> i32;
fn puts(s: *const u8) -> i32;
fn exit(code: i32) -> unreachable;
}
@@ -169,7 +169,7 @@ static void add_compiling_test_cases(void) {
add_source_file(tc, "libc.zig", R"SOURCE(
#link("c")
extern {
pub fn puts(s: *mut u8) -> i32;
pub fn puts(s: *const u8) -> i32;
pub fn exit(code: i32) -> unreachable;
}
)SOURCE");