Skip to content

long double becomes u128 #1549

Open
Open
@aDotInTheVoid

Description

@aDotInTheVoid

Input C/C++ Header

typedef long double foo

Bindgen Invocation

$ bindgen input.h 

Actual Results

/* automatically generated by rust-bindgen */

pub type a = u128;

Expected Results

I'm not entirely sure. Here are the idea's I can think of

  • use f64, but that leeds to it's own set of issues (Incorrect size for long double when using old rust_target #1529).
  • use the f128 crate but the layout of the f128 is different to the layout of a c long double
  • add a c_longdouble type to std::os::raw. The problem is that on many machines (including mine) long double is a 16 byte float, which rust doesn't suport
  • Through an error. This will avoid confusion, but also make also will mean losing suport for many .h files
  • use u128. The problem here is were treating a float as an int, and that will mean all sorts of problems

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions