#include <stdatomic.h>
// *** 以前 ***
//C11:原子变量通过一个宏来初始化
atomic_int hitsOld = ATOMIC_VAR_INIT(0);
atomic_fetch_add(&hitsOld, 5);
// *** 在 C17 版本中 ***
//C17 是只修复缺陷、没有新特性的版本。
//其中一项修复使该宏过时:用普通初始化器即可
//(C23 删除了该宏)
atomic_int hits = 0;
atomic_fetch_add(&hits, 5);
//hits is 5
//在 C17 下 __STDC_VERSION__ 为 201710L(在 C23 下为 202311L)
printf("hits is %d\n", atomic_load(&hits));