1#![allow(non_upper_case_globals)]
26#![allow(non_camel_case_types)]
27#![allow(non_snake_case)]
28#![allow(missing_docs)]
29#![allow(unsafe_code)]
30
31use std::{
32 ffi::{c_char, c_int, c_longlong, c_short},
33 mem::size_of,
34};
35include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
36
37use lc_framework_src as _;
38
39#[expect(clippy::manual_assert)]
40pub const MAX_STAGES: usize = const {
41 if max_stages < 0 {
42 panic!("max_stages must not be negative");
43 }
44
45 let _: c_int = max_stages;
46
47 if size_of::<c_int>() > size_of::<usize>() {
48 panic!("max_stages might not fit into usize");
49 }
50
51 max_stages as usize
52};
53
54#[expect(clippy::manual_assert)]
55const _: () = const {
56 if CS % 8 != 0 {
57 panic!("CS must be a multiple of 8")
58 }
59};
60
61#[cfg(not(target_endian = "little"))]
62compile_error!("LC framework only supports little-endian systems");
63
64#[expect(clippy::manual_assert)]
65const _: () = const {
66 if size_of::<c_longlong>() != 8 {
67 panic!("long long must be 8 bytes")
68 }
69};
70#[expect(clippy::manual_assert)]
71const _: () = const {
72 if size_of::<c_int>() != 4 {
73 panic!("int must be 4 bytes")
74 }
75};
76#[expect(clippy::manual_assert)]
77const _: () = const {
78 if size_of::<c_short>() != 2 {
79 panic!("short must be 2 bytes")
80 }
81};
82#[expect(clippy::manual_assert)]
83const _: () = const {
84 if size_of::<c_char>() != 1 {
85 panic!("char must be 1 byte")
86 }
87};