circuitpython/tests/unix/ffi_lib.c
Damien George 20a8f4f7ec tests/unix: Add ffi test for integer types.
Signed-off-by: Damien George <damien@micropython.org>
2021-06-06 22:52:25 +10:00

34 lines
398 B
C

#include <stdint.h>
int8_t f8i(int8_t x) {
return x ^ 1;
}
uint8_t f8u(uint8_t x) {
return x ^ 1;
}
int16_t f16i(int16_t x) {
return x ^ 1;
}
uint16_t f16u(uint16_t x) {
return x ^ 1;
}
int32_t f32i(int32_t x) {
return x ^ 1;
}
uint32_t f32u(uint32_t x) {
return x ^ 1;
}
int64_t f64i(int64_t x) {
return x ^ 1;
}
uint64_t f64u(uint64_t x) {
return x ^ 1;
}