Skip to content

Commit 3a55a1d

Browse files
committed
initial c2rust translation
1 parent eaedcc1 commit 3a55a1d

File tree

8 files changed

+4472
-0
lines changed

8 files changed

+4472
-0
lines changed

Cargo.lock

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[workspace]
2+
members = [
3+
]
4+
[package]
5+
name = "c2rust_out"
6+
authors = ["C2Rust"]
7+
version = "0.0.0"
8+
publish = false
9+
edition = "2021"
10+
autobins = false
11+
12+
[lib]
13+
name = "c2rust_out"
14+
path = "c2rust-lib.rs"
15+
crate-type = ["staticlib", "rlib"]
16+
[dependencies]
17+
c2rust-bitfields= "0.3"
18+
libc= "0.2"

build.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#[cfg(all(unix, not(target_os = "macos")))]
2+
fn main() {
3+
// add unix dependencies below
4+
// println!("cargo:rustc-flags=-l readline");
5+
}
6+
7+
#[cfg(target_os = "macos")]
8+
fn main() {
9+
// add macos dependencies below
10+
// println!("cargo:rustc-flags=-l edit");
11+
}

c2rust-lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![allow(dead_code)]
2+
#![allow(mutable_transmutes)]
3+
#![allow(non_camel_case_types)]
4+
#![allow(non_snake_case)]
5+
#![allow(non_upper_case_globals)]
6+
#![allow(unused_assignments)]
7+
#![allow(unused_mut)]
8+
9+
#[macro_use]
10+
extern crate c2rust_bitfields;
11+
extern crate libc;
12+
pub mod z80;

compile_commands.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[
2+
{
3+
"directory": "/home/cake/dev/trueLMAO/notes/jgz80",
4+
"arguments": [
5+
"cc",
6+
"-g",
7+
"-Wall",
8+
"-Wextra",
9+
"-O2",
10+
"-std=c11",
11+
"-pedantic",
12+
"-c",
13+
"-o",
14+
"z80.o",
15+
"z80.c"
16+
],
17+
"file": "z80.c"
18+
}
19+
]

porting-notes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
translate with;
2+
https://github.com/immunant/c2rust
3+
to create a compilation db for makefile scripts;
4+
https://github.com/nickdiego/compiledb

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "nightly-2022-08-08"
3+
components = ["rustfmt-preview", "rustc-dev", "rust-src", "miri"]

0 commit comments

Comments
 (0)