Skip to content

Commit 770b82e

Browse files
committed
Update docs.
修改: doc/architectures.md 修改: doc/compilers.md 修改: doc/languagestandards.md 修改: doc/platforms.md 修改: src/architectures.h
1 parent b4a1494 commit 770b82e

File tree

5 files changed

+181
-329
lines changed

5 files changed

+181
-329
lines changed

doc/architectures.md

Lines changed: 28 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,39 @@
11
# Architectures
22
## Source
3-
include/platform_predef/architectures.h
3+
src/architectures.h
44
## Content
55
### \_\_arch\_\_
66
#### Type
7-
macro
7+
macros
88
#### Description
99
Represents the processor architecture type
1010
If the judgment fails, the value is '\_\_arch_unknown\_\_'
11-
##### We provide preset architecture types
12-
```c
13-
/*Alpha*/
14-
#define __arch_alpha__ 1
15-
/*x86*/
16-
#define __arch_x86__ 2
17-
/*ARM*/
18-
#define __arch_arm__ 3
19-
/*Blackfin*/
20-
#define __arch_blackfin__ 4
21-
/*Convex*/
22-
#define __arch_convex__ 5
23-
/*Epiphany*/
24-
#define __arch_epiphany__ 6
25-
/*HP/PA RISC*/
26-
#define __arch_hppa__ 7
27-
/*Itanium*/
28-
#define __arch_itanium__ 8
29-
/*Motorola 68k*/
30-
#define __arch_motorola68k__ 9
31-
/*MIPS*/
32-
#define __arch_mips__ 10
33-
/*PowerPC*/
34-
#define __arch_ppc__ 11
35-
/*Pyramid 9810*/
36-
#define __arch_pyramid9810__ 12
37-
/*RS/6000*/
38-
#define __arch_rs6000__ 13
39-
/*SPARC*/
40-
#define __arch_sparc__ 14
41-
/*SuperH*/
42-
#define __arch_superh__ 15
43-
/*SystemZ*/
44-
#define __arch_systemz__ 16
45-
/*TMS320*/
46-
#define __arch_tms320__ 17
47-
/*TMS470*/
48-
#define __arch_tms470__ 18
49-
/*unknown arch*/
50-
#define __arch_unknown__ 0
51-
```
11+
#### We provide preset architecture macros
12+
| Architecture | Macro |
13+
| :----: | :----: |
14+
| Alpha | \_\_arch_alpha\_\_ |
15+
| x86 | \_\_arch_x86\_\_ |
16+
| ARM | \_\_arch_arm\_\_ |
17+
| Blackfin | \_\_arch_blackfin\_\_ |
18+
| Convex | \_\_arch_convex\_\_ |
19+
| Epiphany | \_\_arch_epiphany\_\_ |
20+
| HP/PA RISC | \_\_arch_hppa\_\_ |
21+
| Itanium | \_\_arch_itanium\_\_ |
22+
| Motorola8k | \_\_arch_motorola68k\_\_ |
23+
| MIPS | \_\_arch_mips\_\_0 |
24+
| PowerPC | \_\_arch_ppc\_\_1 |
25+
| Pyramid810 | \_\_arch_pyramid9810\_\_2 |
26+
| RS/6000 | \_\_arch_rs6000\_\_3 |
27+
| SPARC | \_\_arch_sparc\_\_4 |
28+
| SuperH | \_\_arch_superh\_\_5 |
29+
| SystemZ | \_\_arch_systemz\_\_6 |
30+
| TMS320 | \_\_arch_tms320\_\_7 |
31+
| TMS470 | \_\_arch_tms470\_\_8 |
32+
| Unknown architecture | \_\_arch_unknown\_\_ |
33+
5234
#### Usage
5335
```c
54-
#include <platform_predef.h>
36+
#include <cppp/cppp-platform.h>
5537
#if (__arch__ == __arch_x86__)
5638
#pragma message "Build in x86 arch"
5739
#elif (__arch__ == __arch_arm__)
@@ -69,7 +51,7 @@ Architecture name, like 'uname -m'
6951
If the judgment fails, the value is "unknown"
7052
#### Usage
7153
```c
72-
#include <platform_predef.h>
54+
#include <cppp/cppp-platform.h>
7355
#include <stdio.h>
7456
int main()
7557
{
@@ -84,7 +66,7 @@ This represents the calculation formula for pointer length
8466
The value is generally 32 or 64
8567
#### Usage
8668
```c
87-
#include <cppp/libplatform.h>
69+
#include <cppp/cppp-platform.h>
8870
#include <stdio.h>
8971
int main()
9072
{

doc/compilers.md

Lines changed: 80 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,165 +1,94 @@
11
# Compilers
22
## Source
3-
include/platform_predef/compilers.h
3+
src/compilers.h
44
## Content
5-
## \_\_has_xxx_compiler\_\_
5+
### \_\_has_xxx_compiler\_\_
66
#### Type
77
macros
88
#### Description
99
1 if there is a corresponding compiler, otherwise 0.
10-
The 'xxx' here refers to the compiler name, and details can be found in the 'src/lpcomps.h' source code.
10+
The 'xxx' here refers to the compiler name, and details can be found in the 'src/compilers.h' source code.
1111

12-
**Note: An environment may contain multiple compiler environments**
12+
**Note: An environment may contain multiple compiler environments.**
1313
#### Usage
1414
```c
15-
#include <cppp/libplatform.h>
15+
#include <cppp/cppp-platform.h>
1616
#if __has_msvc_compiler__
17-
#error "You are compile with MSVC!"
17+
#error "This project do not support MSVC!"
1818
#endif
1919
int main(){}
2020
```
21-
#### Prototype
22-
```c
23-
/*ACC*/
24-
#define __has_acc_compiler__ 0
25-
/*Altium MicroBlaze C*/
26-
#define __has_has_altium_microblaze_c_compiler__ 0
27-
/*Altium C-to-Hardware*/
28-
#define __has_altium_c_to_hardware_compiler__ 0
29-
/*Amsterdam Compiler Kit*/
30-
#define __has_amsterdam_compiler__ 0
31-
/*ARM Compiler*/
32-
#define __has_arm_compiler__ 0
33-
/*Aztec C*/
34-
#define __has_aztec_c_compiler__ 0
35-
/*Borland C/C++*/
36-
#define __has_borland_compiler__ 0
37-
/*CC65*/
38-
#define __has_cc65_compiler__ 0
39-
/*Clang*/
40-
#define __has_clang_compiler__ 0
41-
/*Comeau*/
42-
#define __has_comeau_compiler__ 0
43-
/*Compaq C/C++*/
44-
#define __has_compaq_compiler__ 0
45-
/*Convex C*/
46-
#define __has_convex_c_compiler__ 0
47-
/*CompCert*/
48-
#define __has_compcert_compiler__ 0
49-
/*Coverity C/C++ Static Analyzer*/
50-
#define __has_coverity_compiler__ 0
51-
/*Cray C*/
52-
#define __has_cray_c_compiler__ 0
53-
/*Diab C/C++*/
54-
#define __has_diab_compiler__ 0
55-
/*DICE C*/
56-
#define __has_dice_c_compiler__ 0
57-
/*Digital Mars*/
58-
#define __has_digital_mars_compiler__ 0
59-
/*Dignus Systems/C++*/
60-
#define __has_dignus_systems_compiler__ 0
61-
/*DJGPP*/
62-
#define __has_djgpp_compiler__ 0
63-
/*EDG C++ Frontend*/
64-
#define __has_edg_compiler__ 0
65-
/*EKOPath*/
66-
#define __has_ekopath_compiler__ 0
67-
/*Fujitsu C++*/
68-
#define __has_fujitsu_compiler__ 0
69-
/*GCC C/C++*/
70-
#define __has_gcc_compiler__ 0
71-
/*Green Hill C/C++*/
72-
#define __has_greenhill_compiler__ 0
73-
/*HP ANSI C*/
74-
#define __has_hpansi_c_compiler__ 0
75-
/*HP aC++*/
76-
#define __has_hpa_compiler__ 0
77-
/*IAR C/C++*/
78-
#define __has_iar_compiler__ 0
79-
/*ImageCraft C*/
80-
#define __has_imagecraft_c_compiler__ 0
81-
/*Intel C/C++*/
82-
#define __has_intel_compiler__ 0
83-
/*KAI C++*/
84-
#define __has_kai_compiler__ 0
85-
/*KEIL CARM*/
86-
#define __has_keil_carm_compiler__ 0
87-
/*KEIL C166*/
88-
#define __has_keil_c166_compiler__ 0
89-
/*KEIL C51*/
90-
#define __has_keil_c51_compiler__ 0
91-
/*LCC*/
92-
#define __has_lcc_compiler__ 0
93-
/*LLVM*/
94-
#define __has_llvm_compiler__ 0
95-
/*MetaWare High C/C++*/
96-
#define __has_metaware_high_compiler__ 0
97-
/*Metrowerks CodeWarrior*/
98-
#define __has_metrowerks_codewarrior_compiler__ 0
99-
/*Microsoft Visual C++*/
100-
#define __has_msvc_compiler__ 0
101-
/*Microtec C/C++*/
102-
#define __has_microtec_compiler__ 0
103-
/*Microway NDP C*/
104-
#define __has_microway_ndp_c_compiler__ 0
105-
/*MinGW*/
106-
#define __has_mingw_compiler__ 0
107-
/*MIPSpro*/
108-
#define __has_mipspro_compiler__ 0
109-
/*Miracle C*/
110-
#define __has_miracle_c_compiler__ 0
111-
/*MPW C++*/
112-
#define __has_mpr_compiler__ 0
113-
/*Norcroft C*/
114-
#define __has_norcroft_c_compiler__ 0
115-
/*NWCC*/
116-
#define __has_nwcc_compiler__ 0
117-
/*Open64*/
118-
#define __has_open64_compiler__ 0
119-
/*Oracle Pro*C Precompiler*/
120-
#define __has_oracle_pro_compiler__ 0
121-
/*Oracle Solaris Studio*/
122-
#define __has_oracle_solaris_studio_compiler__ 0
123-
/*Pacific C*/
124-
#define __has_pacific_c_compiler__ 0
125-
/*Palm C/C++*/
126-
#define __has_palm_compiler__ 0
127-
/*Pelles C*/
128-
#define __has_pelles_c_compiler__ 0
129-
/*Portland Group C/C++*/
130-
#define __has_portland_group_compiler__ 0
131-
/*Renesas C/C++*/
132-
#define __has_renesas_compiler__ 0
133-
/*SAS/C*/
134-
#define __has_sas_c_compiler__ 0
135-
/*SCO OpenServer*/
136-
#define __has_sco_compiler__ 0
137-
/*Small Device C Compiler*/
138-
#define __has_small_device_compiler__ 0
139-
/*SN Compiler*/
140-
#define __has_sn_compiler__ 0
141-
/*Stratus VOS C*/
142-
#define __has_stratus_vos_c_compiler__ 0
143-
/*Symantec C++*/
144-
#define __has_symantec_compiler__ 0
145-
/*TenDRA C/C++*/
146-
#define __has_tendra_compiler__ 0
147-
/*Texas Instruments C/C++ Compiler*/
148-
#define __has_texas_instruments_compiler__ 0
149-
/*THINK C*/
150-
#define __has_think_c_compiler__ 0
151-
/*Tiny C*/
152-
#define __has_tiny_c_compiler__ 0
153-
/*Turbo C/C++*/
154-
#define __has_turboc_compiler__ 0
155-
/*Ultimate C/C++*/
156-
#define __has_ultimate_compiler__ 0
157-
/*USL C*/
158-
#define __has_usl_c_compiler__ 0
159-
/*VBCC*/
160-
#define __has_vbcc_compiler__ 0
161-
/*Watcom C++*/
162-
#define __has_watcom_compiler__ 0
163-
/*Zortech C++*/
164-
#define __has_zortech_compiler__ 0
165-
```
21+
#### We provide preset compiler macros
22+
| Compiler | Macro |
23+
| :----: | :----: |
24+
| ACC | \_\_has_acc_compiler\_\_ |
25+
| Altium MicroBlaze C | \_\_has_has_altium_microblaze_c_compiler\_\_ |
26+
| Altium C-to-Hardware | \_\_has_altium_c_to_hardware_compiler\_\_ |
27+
| Amsterdam Compiler Kit | \_\_has_amsterdam_compiler\_\_ |
28+
| ARM Compiler | \_\_has_arm_compiler\_\_ |
29+
| Aztec C | \_\_has_aztec_c_compiler\_\_ |
30+
| Borland C/C++ | \_\_has_borland_compiler\_\_ |
31+
| CC65 | \_\_has_cc65_compiler\_\_ |
32+
| Clang | \_\_has_clang_compiler\_\_ |
33+
| Comeau | \_\_has_comeau_compiler\_\_ |
34+
| Compaq C/C++ | \_\_has_compaq_compiler\_\_ |
35+
| Convex C | \_\_has_convex_c_compiler\_\_ |
36+
| CompCert | \_\_has_compcert_compiler\_\_ |
37+
| Coverity C/C++ Static Analyzer | \_\_has_coverity_compiler\_\_ |
38+
| Cray C | \_\_has_cray_c_compiler\_\_ |
39+
| Diab C/C++ | \_\_has_diab_compiler\_\_ |
40+
| DICE C | \_\_has_dice_c_compiler\_\_ |
41+
| Digital Mars | \_\_has_digital_mars_compiler\_\_ |
42+
| Dignus Systems/C++ | \_\_has_dignus_systems_compiler\_\_ |
43+
| DJGPP | \_\_has_djgpp_compiler\_\_ |
44+
| EDG C++ Frontend | \_\_has_edg_compiler\_\_ |
45+
| EKOPath | \_\_has_ekopath_compiler\_\_ |
46+
| Fujitsu C++ | \_\_has_fujitsu_compiler\_\_ |
47+
| GCC C/C++ | \_\_has_gcc_compiler\_\_ |
48+
| Green Hill C/C++ | \_\_has_greenhill_compiler\_\_ |
49+
| HP ANSI C | \_\_has_hpansi_c_compiler\_\_ |
50+
| HP aC++ | \_\_has_hpa_compiler\_\_ |
51+
| IAR C/C++ | \_\_has_iar_compiler\_\_ |
52+
| ImageCraft C | \_\_has_imagecraft_c_compiler\_\_ |
53+
| Intel C/C++ | \_\_has_intel_compiler\_\_ |
54+
| KAI C++ | \_\_has_kai_compiler\_\_ |
55+
| KEIL CARM | \_\_has_keil_carm_compiler\_\_ |
56+
| KEIL C166 | \_\_has_keil_c166_compiler\_\_ |
57+
| KEIL C51 | \_\_has_keil_c51_compiler\_\_ |
58+
| LCC | \_\_has_lcc_compiler\_\_ |
59+
| LLVM | \_\_has_llvm_compiler\_\_ |
60+
| MetaWare High C/C++ | \_\_has_metaware_high_compiler\_\_ |
61+
| Metrowerks CodeWarrior | \_\_has_metrowerks_codewarrior_compiler\_\_ |
62+
| Microsoft Visual C++ | \_\_has_msvc_compiler\_\_ |
63+
| Microtec C/C++ | \_\_has_microtec_compiler\_\_ |
64+
| Microway NDP C | \_\_has_microway_ndp_c_compiler\_\_ |
65+
| MinGW | \_\_has_mingw_compiler\_\_ |
66+
| MIPSpro | \_\_has_mipspro_compiler\_\_ |
67+
| Miracle C | \_\_has_miracle_c_compiler\_\_ |
68+
| MPW C++ | \_\_has_mpr_compiler\_\_ |
69+
| Norcroft C | \_\_has_norcroft_c_compiler\_\_ |
70+
| NWCC | \_\_has_nwcc_compiler\_\_ |
71+
| Open64 | \_\_has_open64_compiler\_\_ |
72+
| Oracle Pro*C Precompiler | \_\_has_oracle_pro_compiler\_\_ |
73+
| Oracle Solaris Studio | \_\_has_oracle_solaris_studio_compiler\_\_ |
74+
| Pacific C | \_\_has_pacific_c_compiler\_\_ |
75+
| Palm C/C++ | \_\_has_palm_compiler\_\_ |
76+
| Pelles C | \_\_has_pelles_c_compiler\_\_ |
77+
| Portland Group C/C++ | \_\_has_portland_group_compiler\_\_ |
78+
| Renesas C/C++ | \_\_has_renesas_compiler\_\_ |
79+
| SAS/C | \_\_has_sas_c_compiler\_\_ |
80+
| SCO OpenServer | \_\_has_sco_compiler\_\_ |
81+
| Small Device C Compiler | \_\_has_small_device_compiler\_\_ |
82+
| SN Compiler | \_\_has_sn_compiler\_\_ |
83+
| Stratus VOS C | \_\_has_stratus_vos_c_compiler\_\_ |
84+
| Symantec C++ | \_\_has_symantec_compiler\_\_ |
85+
| TenDRA C/C++ | \_\_has_tendra_compiler\_\_ |
86+
| Texas Instruments C/C++ Compiler | \_\_has_texas_instruments_compiler\_\_ |
87+
| THINK C | \_\_has_think_c_compiler\_\_ |
88+
| Tiny C | \_\_has_tiny_c_compiler\_\_ |
89+
| Turbo C/C++ | \_\_has_turboc_compiler\_\_ |
90+
| Ultimate C/C++ | \_\_has_ultimate_compiler\_\_ |
91+
| USL C | \_\_has_usl_c_compiler\_\_ |
92+
| VBCC | \_\_has_vbcc_compiler\_\_ |
93+
| Watcom C++ | \_\_has_watcom_compiler\_\_ |
94+
| Zortech C++ | \_\_has_zortech_compiler\_\_ |

doc/languagestandards.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# C/C++ Standards
22
## Source
3-
include/platform_predef/languagestandards.h
3+
src/languagestandards.h
44
## Content
55
## \_\_has_cXX\_\_
66
#### Type
77
macros
88
#### Description
9-
The 'XX' here refers to the C standard, and details can be found in the 'src/lpstds.h' source code.
9+
The 'XX' here refers to the C standard, and details can be found in the 'src/languagestandards.h' source code.
1010
#### Usage
1111
```c
12-
#include <platform_predef.h>
12+
#include <cppp/cppp-platform.h>
1313
#if __has_c11__
1414
#pragma message "You are in C11."
1515
#endif
@@ -19,10 +19,10 @@ int main(){}
1919
#### Type
2020
macros
2121
#### Description
22-
The 'XX' here refers to the C++ standard, and details can be found in the 'src/lpstds.h' source code.
22+
The 'XX' here refers to the C++ standard, and details can be found in the 'src/languagestandards.h' source code.
2323
#### Usage
2424
```c
25-
#include <cppp/libplatform.h>
25+
#include <cppp/cppp-platform.h>
2626
#if __has_cpp17__
2727
#pragma message "You are in C++17."
2828
#endif
@@ -35,7 +35,7 @@ macro
3535
C++ standard for fixing issues with '\_MSVC_LANG'
3636
### Usage
3737
```cpp
38-
#include <platform_predef.h>
38+
#include <cppp/cppp-platform.h>
3939
#include <iostream>
4040
int main()
4141
{

0 commit comments

Comments
 (0)