1 /**
2  * This file is part of DCD, a development tool for the D programming language.
3  * Copyright (C) 2014 Brian Schott
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 module dcd.common.constants;
20 
21 public import dcd.common.constants2;
22 
23 // The lists in this module should be kept sorted.
24 
25 struct ConstantCompletion
26 {
27 	string identifier;
28 	string ddoc;
29 }
30 
31 /**
32  * Linkage types
33  */
34 immutable ConstantCompletion[] linkages = [
35 	// https://dlang.org/spec/attribute.html#linkage
36 	// custom typed instead of copied from the docs to fit completions better
37 	ConstantCompletion("C", "Enforces C calling conventions for the function, no mangling."),
38 	ConstantCompletion("C++", "Offers limited compatibility with C++."),
39 	ConstantCompletion("D", "Default D mangling and calling conventions."),
40 	ConstantCompletion("Objective-C", "Objective-C offers limited compatibility with Objective-C, see the "
41 		~ "$(LINK2 objc_interface.html, Interfacing to Objective-C) documentation for more information."),
42 	ConstantCompletion("Pascal"),
43 	ConstantCompletion("System", "`Windows` on Windows platforms, `C` on other platforms."),
44 	ConstantCompletion("Windows", "Enforces Win32/`__stdcall` conventions for the function.")
45 ];
46 
47 /**
48  * Scope conditions
49  */
50 immutable ConstantCompletion[] scopes = [
51 	ConstantCompletion("exit", "Executes statements when the scope exits normally or due to exception unwinding."),
52 	ConstantCompletion("failure", "Executes statements when the scope exits due to exception unwinding."),
53 	ConstantCompletion("success", "Executes statements when the scope exits normally.")
54 ];
55 
56 /**
57  * Compiler-defined values for version() conditions.
58  */
59 immutable ConstantCompletion[] predefinedVersions = [
60 	ConstantCompletion("AArch64"),
61 	ConstantCompletion("AIX"),
62 	ConstantCompletion("all"),
63 	ConstantCompletion("Alpha"),
64 	ConstantCompletion("Alpha_HardFloat"),
65 	ConstantCompletion("Alpha_SoftFloat"),
66 	ConstantCompletion("Android"),
67 	ConstantCompletion("ARM"),
68 	ConstantCompletion("ARM_HardFloat"),
69 	ConstantCompletion("ARM_SoftFloat"),
70 	ConstantCompletion("ARM_SoftFP"),
71 	ConstantCompletion("ARM_Thumb"),
72 	ConstantCompletion("assert"),
73 	ConstantCompletion("BigEndian"),
74 	ConstantCompletion("BSD"),
75 	ConstantCompletion("CRuntime_Bionic"),
76 	ConstantCompletion("CRuntime_DigitalMars"),
77 	ConstantCompletion("CRuntime_Glibc"),
78 	ConstantCompletion("CRuntime_Microsoft"),
79 	ConstantCompletion("Cygwin"),
80 	ConstantCompletion("DigitalMars"),
81 	ConstantCompletion("DragonFlyBSD"),
82 	ConstantCompletion("D_Coverage"),
83 	ConstantCompletion("D_Ddoc"),
84 	ConstantCompletion("D_HardFloat"),
85 	ConstantCompletion("D_InlineAsm_X86"),
86 	ConstantCompletion("D_InlineAsm_X86_64"),
87 	ConstantCompletion("D_LP64"),
88 	ConstantCompletion("D_NoBoundsChecks"),
89 	ConstantCompletion("D_PIC"),
90 	ConstantCompletion("D_SIMD"),
91 	ConstantCompletion("D_SoftFloat"),
92 	ConstantCompletion("D_Version2"),
93 	ConstantCompletion("D_X32"),
94 	ConstantCompletion("ELFv1"),
95 	ConstantCompletion("ELFv2"),
96 	ConstantCompletion("Epiphany"),
97 	ConstantCompletion("FreeBSD"),
98 	ConstantCompletion("FreeStanding"),
99 	ConstantCompletion("GNU"),
100 	ConstantCompletion("Haiku"),
101 	ConstantCompletion("HPPA"),
102 	ConstantCompletion("HPPA64"),
103 	ConstantCompletion("Hurd"),
104 	ConstantCompletion("IA64"),
105 	ConstantCompletion("iOS"),
106 	ConstantCompletion("LDC"),
107 	ConstantCompletion("linux"),
108 	ConstantCompletion("LittleEndian"),
109 	ConstantCompletion("MinGW"),
110 	ConstantCompletion("MIPS32"),
111 	ConstantCompletion("MIPS64"),
112 	ConstantCompletion("MIPS_EABI"),
113 	ConstantCompletion("MIPS_HardFloat"),
114 	ConstantCompletion("MIPS_N32"),
115 	ConstantCompletion("MIPS_N64"),
116 	ConstantCompletion("MIPS_O32"),
117 	ConstantCompletion("MIPS_O64"),
118 	ConstantCompletion("MIPS_SoftFloat"),
119 	ConstantCompletion("NetBSD"),
120 	ConstantCompletion("none"),
121 	ConstantCompletion("NVPTX"),
122 	ConstantCompletion("NVPTX64"),
123 	ConstantCompletion("OpenBSD"),
124 	ConstantCompletion("OSX"),
125 	ConstantCompletion("PlayStation"),
126 	ConstantCompletion("PlayStation4"),
127 	ConstantCompletion("Posix"),
128 	ConstantCompletion("PPC"),
129 	ConstantCompletion("PPC64"),
130 	ConstantCompletion("PPC_HardFloat"),
131 	ConstantCompletion("PPC_SoftFloat"),
132 	ConstantCompletion("RISCV32"),
133 	ConstantCompletion("RISCV64"),
134 	ConstantCompletion("S390"),
135 	ConstantCompletion("S390X"),
136 	ConstantCompletion("SDC"),
137 	ConstantCompletion("SH"),
138 	ConstantCompletion("SH64"),
139 	ConstantCompletion("SkyOS"),
140 	ConstantCompletion("Solaris"),
141 	ConstantCompletion("SPARC"),
142 	ConstantCompletion("SPARC64"),
143 	ConstantCompletion("SPARC_HardFloat"),
144 	ConstantCompletion("SPARC_SoftFloat"),
145 	ConstantCompletion("SPARC_V8Plus"),
146 	ConstantCompletion("SystemZ"),
147 	ConstantCompletion("SysV3"),
148 	ConstantCompletion("SysV4"),
149 	ConstantCompletion("TVOS"),
150 	ConstantCompletion("unittest"),
151 	ConstantCompletion("WatchOS"),
152 	ConstantCompletion("Win32"),
153 	ConstantCompletion("Win64"),
154 	ConstantCompletion("Windows"),
155 	ConstantCompletion("X86"),
156 	ConstantCompletion("X86_64")
157 ];