c interop type foundation
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
struct Buffer {
|
||||
const char *data;
|
||||
unsigned long length;
|
||||
};
|
||||
|
||||
static const struct Buffer buffer = {"ok", 2};
|
||||
|
||||
const struct Buffer *get_buffer(void) {
|
||||
return &buffer;
|
||||
}
|
||||
|
||||
int verify(
|
||||
char char_value,
|
||||
signed char schar_value,
|
||||
unsigned char uchar_value,
|
||||
short short_value,
|
||||
unsigned short ushort_value,
|
||||
int int_value,
|
||||
unsigned int uint_value,
|
||||
long long_value,
|
||||
unsigned long ulong_value,
|
||||
long long longlong_value,
|
||||
unsigned long long ulonglong_value,
|
||||
float float_value,
|
||||
double double_value,
|
||||
long double longdouble_value
|
||||
) {
|
||||
return char_value == 1 &&
|
||||
schar_value == -2 &&
|
||||
uchar_value == 3 &&
|
||||
short_value == -4 &&
|
||||
ushort_value == 5 &&
|
||||
int_value == -6 &&
|
||||
uint_value == 7 &&
|
||||
long_value == -8 &&
|
||||
ulong_value == 9 &&
|
||||
longlong_value == -10 &&
|
||||
ulonglong_value == 11 &&
|
||||
float_value == 12.0f &&
|
||||
double_value == 13.0 &&
|
||||
longdouble_value == 14.0L;
|
||||
}
|
||||
Reference in New Issue
Block a user