@@ -230,18 +230,18 @@ CF_JVal cf_json_array_get(CF_JVal val_handle, int index)
230230}
231231
232232// Make sure memory layout is identical.
233- static_assert (sizeof (CF_JIter) == sizeof (yyjson_mut_arr_iter));
234- static_assert (offsetof(CF_JIter, index) == offsetof(yyjson_mut_arr_iter, idx));
235- static_assert (offsetof(CF_JIter, count) == offsetof(yyjson_mut_arr_iter, max));
236- static_assert (offsetof(CF_JIter, val) == offsetof(yyjson_mut_arr_iter, cur));
237- static_assert (offsetof(CF_JIter, prev) == offsetof(yyjson_mut_arr_iter, pre ));
238- static_assert (offsetof(CF_JIter, parent) == offsetof(yyjson_mut_arr_iter, arr));
239- static_assert (sizeof (CF_JIter) == sizeof (yyjson_mut_obj_iter));
240- static_assert (offsetof(CF_JIter, index) == offsetof(yyjson_mut_obj_iter, idx));
241- static_assert (offsetof(CF_JIter, count) == offsetof(yyjson_mut_obj_iter, max));
242- static_assert (offsetof(CF_JIter, val) == offsetof(yyjson_mut_obj_iter, cur));
243- static_assert (offsetof(CF_JIter, prev) == offsetof(yyjson_mut_obj_iter, pre ));
244- static_assert (offsetof(CF_JIter, parent) == offsetof(yyjson_mut_obj_iter, obj));
233+ CF_STATIC_ASSERT (sizeof (CF_JIter) == sizeof (yyjson_mut_arr_iter), " CF_JIter must match yyjson_mut_arr_iter's layout " );
234+ CF_STATIC_ASSERT (offsetof(CF_JIter, index) == offsetof(yyjson_mut_arr_iter, idx), " CF_JIter must match yyjson_mut_arr_iter's layout " );
235+ CF_STATIC_ASSERT (offsetof(CF_JIter, count) == offsetof(yyjson_mut_arr_iter, max), " CF_JIter must match yyjson_mut_arr_iter's layout " );
236+ CF_STATIC_ASSERT (offsetof(CF_JIter, val) == offsetof(yyjson_mut_arr_iter, cur), " CF_JIter must match yyjson_mut_arr_iter's layout " );
237+ CF_STATIC_ASSERT (offsetof(CF_JIter, prev) == offsetof(yyjson_mut_arr_iter, pre ), " CF_JIter must match yyjson_mut_arr_iter's layout " );
238+ CF_STATIC_ASSERT (offsetof(CF_JIter, parent) == offsetof(yyjson_mut_arr_iter, arr), " CF_JIter must match yyjson_mut_arr_iter's layout " );
239+ CF_STATIC_ASSERT (sizeof (CF_JIter) == sizeof (yyjson_mut_obj_iter), " CF_JIter must match yyjson_mut_obj_iter's layout " );
240+ CF_STATIC_ASSERT (offsetof(CF_JIter, index) == offsetof(yyjson_mut_obj_iter, idx), " CF_JIter must match yyjson_mut_obj_iter's layout " );
241+ CF_STATIC_ASSERT (offsetof(CF_JIter, count) == offsetof(yyjson_mut_obj_iter, max), " CF_JIter must match yyjson_mut_obj_iter's layout " );
242+ CF_STATIC_ASSERT (offsetof(CF_JIter, val) == offsetof(yyjson_mut_obj_iter, cur), " CF_JIter must match yyjson_mut_obj_iter's layout " );
243+ CF_STATIC_ASSERT (offsetof(CF_JIter, prev) == offsetof(yyjson_mut_obj_iter, pre ), " CF_JIter must match yyjson_mut_obj_iter's layout " );
244+ CF_STATIC_ASSERT (offsetof(CF_JIter, parent) == offsetof(yyjson_mut_obj_iter, obj), " CF_JIter must match yyjson_mut_obj_iter's layout " );
245245
246246CF_JIter cf_json_iter (CF_JVal val_handle)
247247{
0 commit comments