File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #include < netinet/in.h>
2+
3+ int main () {
4+ int tcp = IPPROTO_TCP ;
5+ int udp = IPPROTO_UDP ;
6+ int ip = IPPROTO_IP ;
7+ return tcp + udp + ip;
8+ }
Original file line number Diff line number Diff line change 1+ extern crate libcc2rs;
2+ use libcc2rs:: * ;
3+ use std:: cell:: RefCell ;
4+ use std:: collections:: BTreeMap ;
5+ use std:: io:: prelude:: * ;
6+ use std:: io:: { Read , Seek , Write } ;
7+ use std:: os:: fd:: AsFd ;
8+ use std:: rc:: { Rc , Weak } ;
9+ pub fn main ( ) {
10+ std:: process:: exit ( main_0 ( ) ) ;
11+ }
12+ fn main_0 ( ) -> i32 {
13+ let tcp: Value < i32 > = Rc :: new ( RefCell :: new ( ( libc:: IPPROTO_TCP as i32 ) ) ) ;
14+ let udp: Value < i32 > = Rc :: new ( RefCell :: new ( ( libc:: IPPROTO_UDP as i32 ) ) ) ;
15+ let ip: Value < i32 > = Rc :: new ( RefCell :: new ( ( libc:: IPPROTO_IP as i32 ) ) ) ;
16+ return ( ( ( * tcp. borrow ( ) ) + ( * udp. borrow ( ) ) ) + ( * ip. borrow ( ) ) ) ;
17+ }
Original file line number Diff line number Diff line change 1+ extern crate libc;
2+ use libc:: * ;
3+ extern crate libcc2rs;
4+ use libcc2rs:: * ;
5+ use std:: collections:: BTreeMap ;
6+ use std:: io:: { Read , Seek , Write } ;
7+ use std:: os:: fd:: { AsFd , FromRawFd , IntoRawFd } ;
8+ use std:: rc:: Rc ;
9+ pub fn main ( ) {
10+ unsafe {
11+ std:: process:: exit ( main_0 ( ) as i32 ) ;
12+ }
13+ }
14+ unsafe fn main_0 ( ) -> i32 {
15+ let mut tcp: i32 = ( libc:: IPPROTO_TCP as i32 ) ;
16+ let mut udp: i32 = ( libc:: IPPROTO_UDP as i32 ) ;
17+ let mut ip: i32 = ( libc:: IPPROTO_IP as i32 ) ;
18+ return ( ( ( tcp) + ( udp) ) + ( ip) ) ;
19+ }
You can’t perform that action at this time.
0 commit comments