enums
This commit is contained in:
@@ -16,6 +16,7 @@ int imported_redeclared_array[4] = {13, 14, 15, 16};
|
||||
Imported_Value imported_record_global = {40};
|
||||
const Imported_Array_Record imported_const_array_record = {{20, 21}};
|
||||
Imported_Array_Record imported_mutable_array_record = {{0, 1}};
|
||||
Imported_Enum imported_enum_global = IMPORTED_ENUM_VALUE;
|
||||
int child_shared_global = 0;
|
||||
|
||||
int child_value(int value) {
|
||||
@@ -56,6 +57,38 @@ int imported_apply(Imported_Mapper mapper, int value) {
|
||||
return result;
|
||||
}
|
||||
|
||||
int imported_enum_check(Imported_Enum first, Imported_Enum second) {
|
||||
if (!(first == IMPORTED_ENUM_NEGATIVE && second == IMPORTED_ENUM_VALUE)) {
|
||||
abort();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int imported_enum_variadic(int expected, ...) {
|
||||
va_list args;
|
||||
va_start(args, expected);
|
||||
int value = va_arg(args, int);
|
||||
va_end(args);
|
||||
if (value != expected) {
|
||||
abort();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Imported_Enum_Record imported_enum_record(Imported_Enum_Record value) {
|
||||
if (value.value != IMPORTED_ENUM_BACK) {
|
||||
abort();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Imported_Enum imported_enum_apply(Imported_Enum_Callback callback, Imported_Enum value) {
|
||||
if (callback == NULL || callback(value) != value) {
|
||||
abort();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int imported_check_state(
|
||||
Imported_Color color,
|
||||
int macro_value,
|
||||
|
||||
Reference in New Issue
Block a user