Skip to content

Commit

Permalink
soft fail on missing C11
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhammond authored and Jeff Hammond committed Apr 29, 2019
1 parent 95d36c7 commit 56f5547
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions test/test_c11.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#if __STDC_VERSION__ < 201112L

#warning Empty test due to lack of C11 support.
int main(void) { return 1; }

#else

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdatomic.h>

#include <assert.h>

#if __STDC_VERSION__ >= 201112L
# include <stdbool.h>
# include <stdatomic.h>
#endif

int main(int argc, char **argv)
{
#if __STDC_VERSION__ >= 201112L
atomic_int a, b;
int c;

Expand Down Expand Up @@ -51,8 +47,9 @@ int main(int argc, char **argv)
assert(1 == atomic_load_explicit(&a, memory_order_relaxed));

printf("success!\n");

#else
printf("C11 not supported!\n");
#endif
return 0;
}

#endif

0 comments on commit 56f5547

Please sign in to comment.