fsize 0.1.0

`fsize` is aliased to the floating-point type of pointer size
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate build_helper;

use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use build_helper::target::pointer_width;

fn main() {
  let out_dir = env::var("OUT_DIR").unwrap();
  let dest_path = Path::new(&out_dir).join("fsize.rs");
  let mut f = File::create(&dest_path).unwrap();
  if let Some(pointer_width) = pointer_width() {
    write!(f, "#[allow(non_camel_case_types)] pub type fsize = f{};", pointer_width).unwrap();
  } else {
    write!(f, "compile_error!(\"Could not detect target pointer width.\");").unwrap();
  }
}