-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCStandard.h
64 lines (56 loc) · 1.33 KB
/
CStandard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef CSTANDARD_H
#define CSTANDARD_H
/* source file CStandard.c
* include file CStandard.h (this file)
* explanation README
*
* Which version of the C standard are we using?
* Print some information to stdout.
*
* declared or defined by this file:
* macro: HAVE_C99
* HAVE_C11
* function prototype: CStandard()
*
* usage:
* #include <CStandard.h>
*
* #ifdef HAVE_C99
* or
* #if HAVE_C99
*
* Mind the indentation!
*
* Defined values of __STDC_VERSION__
* C89 undefined
* C89 + amendment 1 199409L
* C99 199901L
* C11 201112L
*/
#undef HAVE_C99
#undef HAVE_C11
#if defined(__STDC__)
# if defined(__STDC_VERSION__)
# if __STDC_VERSION__ >= 201112L
# define HAVE_C99 1
# define HAVE_C11 1
# elif __STDC_VERSION__ >= 199901L
# define HAVE_C99 1
# endif
# endif
#endif
/* As a single expression,
*
* #define HAVE_C99 (defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
* #define HAVE_C11 (defined(__STDC__) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L))
*/
/* Another version, in the style used by Solaris; we added some indentation.
*
* #if defined(__STDC__)
* # if __STDC_VERSION__ - 0 >= 199901L
* # define HAVE_C99 1
* # endif
* #endif
*/
void CStandard(void);
#endif