Enum target_lexicon::CDataModel
source · #[non_exhaustive]pub enum CDataModel {
LP32,
ILP32,
LLP64,
LP64,
ILP64,
}
Expand description
The C data model used on a target.
See also https://en.cppreference.com/w/c/language/arithmetic_types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
LP32
The data model used most commonly on Win16. long
and pointer
are 32 bits.
ILP32
The data model used most commonly on Win32 and 32-bit Unix systems.
int
, long
, and pointer
are all 32 bits.
LLP64
The data model used most commonly on Win64
long long
, and pointer
are 64 bits.
LP64
The data model used most commonly on 64-bit Unix systems
long
, and pointer
are 64 bits.
ILP64
A rare data model used on early 64-bit Unix systems
int
, long
, and pointer
are all 64 bits.
Implementations§
source§impl CDataModel
impl CDataModel
sourcepub fn pointer_width(self) -> Size
pub fn pointer_width(self) -> Size
The width of a pointer (in the default address space).
sourcepub fn short_size(self) -> Size
pub fn short_size(self) -> Size
The size of a C short
. This is required to be at least 16 bits.
sourcepub fn long_long_size(self) -> Size
pub fn long_long_size(self) -> Size
The size of a C long long
. This is required (in C99+) to be at least 64 bits.
sourcepub fn float_size(self) -> Size
pub fn float_size(self) -> Size
The size of a C float
.
sourcepub fn double_size(self) -> Size
pub fn double_size(self) -> Size
The size of a C double
.
Trait Implementations§
source§impl Clone for CDataModel
impl Clone for CDataModel
source§fn clone(&self) -> CDataModel
fn clone(&self) -> CDataModel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CDataModel
impl Debug for CDataModel
source§impl Hash for CDataModel
impl Hash for CDataModel
source§impl PartialEq<CDataModel> for CDataModel
impl PartialEq<CDataModel> for CDataModel
source§fn eq(&self, other: &CDataModel) -> bool
fn eq(&self, other: &CDataModel) -> bool
self
and other
values to be equal, and is used
by ==
.