zemu 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (285) hide show
  1. checksums.yaml +7 -0
  2. data/lib/zemu/config.rb +312 -0
  3. data/lib/zemu/instance.rb +179 -0
  4. data/lib/zemu.rb +172 -0
  5. data/src/debug.c +118 -0
  6. data/src/debug.h +30 -0
  7. data/src/external/Z/API/Z/ABIs/generic/allocator.h +36 -0
  8. data/src/external/Z/API/Z/ABIs/generic/cipher.h +47 -0
  9. data/src/external/Z/API/Z/ABIs/generic/data codec.h +33 -0
  10. data/src/external/Z/API/Z/ABIs/generic/emulation.h +103 -0
  11. data/src/external/Z/API/Z/ABIs/generic/hash function.h +33 -0
  12. data/src/external/Z/API/Z/ABIs/generic/module.h +33 -0
  13. data/src/external/Z/API/Z/ABIs/generic/wave codec.h +40 -0
  14. data/src/external/Z/API/Z/classes/base/InitializerList.hpp +34 -0
  15. data/src/external/Z/API/Z/classes/base/OpaqueFunctionPointer.hpp +26 -0
  16. data/src/external/Z/API/Z/classes/base/OpaqueMemberFunctionPointer.hpp +26 -0
  17. data/src/external/Z/API/Z/classes/base/Pair.hpp +46 -0
  18. data/src/external/Z/API/Z/classes/base/Range.hpp +111 -0
  19. data/src/external/Z/API/Z/classes/base/SizedString.hpp +66 -0
  20. data/src/external/Z/API/Z/classes/base/Status.hpp +89 -0
  21. data/src/external/Z/API/Z/classes/base/Symbol.hpp +39 -0
  22. data/src/external/Z/API/Z/classes/base/Tuple.hpp +111 -0
  23. data/src/external/Z/API/Z/classes/base/Value2D.hpp +389 -0
  24. data/src/external/Z/API/Z/classes/base/Value3D.hpp +368 -0
  25. data/src/external/Z/API/Z/classes/buffering/RingBuffer.hpp +93 -0
  26. data/src/external/Z/API/Z/classes/buffering/TripleBuffer.hpp +68 -0
  27. data/src/external/Z/API/Z/classes/functional/Functor.hpp +265 -0
  28. data/src/external/Z/API/Z/classes/functional/MemberFunction.hpp +98 -0
  29. data/src/external/Z/API/Z/classes/functional/ObjectMemberFunction.hpp +172 -0
  30. data/src/external/Z/API/Z/classes/functional/ObjectSelector.hpp +219 -0
  31. data/src/external/Z/API/Z/classes/functional/Selector.hpp +146 -0
  32. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABB.hpp +81 -0
  33. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/AABR.hpp +685 -0
  34. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Box.hpp +219 -0
  35. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Circle.hpp +80 -0
  36. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line2D.hpp +93 -0
  37. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Line3D.hpp +80 -0
  38. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Rectangle.hpp +675 -0
  39. data/src/external/Z/API/Z/classes/mathematics/geometry/euclidean/Sphere.hpp +0 -0
  40. data/src/external/Z/API/Z/classes/memory/Shared.hpp +90 -0
  41. data/src/external/Z/API/Z/constants/base.h +35 -0
  42. data/src/external/Z/API/Z/constants/chemical elements.h +6385 -0
  43. data/src/external/Z/API/Z/constants/numbers.h +963 -0
  44. data/src/external/Z/API/Z/constants/version.h +15 -0
  45. data/src/external/Z/API/Z/formats/character set/ASCII.h +158 -0
  46. data/src/external/Z/API/Z/formats/character set/DOS CP437.h +159 -0
  47. data/src/external/Z/API/Z/formats/character set/DOS CP737.h +159 -0
  48. data/src/external/Z/API/Z/formats/character set/DOS CP775.h +159 -0
  49. data/src/external/Z/API/Z/formats/character set/DOS CP850.h +159 -0
  50. data/src/external/Z/API/Z/formats/character set/DOS CP852.h +159 -0
  51. data/src/external/Z/API/Z/formats/character set/DOS CP855.h +159 -0
  52. data/src/external/Z/API/Z/formats/character set/DOS CP857.h +159 -0
  53. data/src/external/Z/API/Z/formats/character set/DOS CP858.h +159 -0
  54. data/src/external/Z/API/Z/formats/character set/DOS CP860.h +159 -0
  55. data/src/external/Z/API/Z/formats/character set/DOS CP861.h +159 -0
  56. data/src/external/Z/API/Z/formats/character set/DOS CP862.h +159 -0
  57. data/src/external/Z/API/Z/formats/character set/DOS CP863.h +159 -0
  58. data/src/external/Z/API/Z/formats/character set/DOS CP864.h +159 -0
  59. data/src/external/Z/API/Z/formats/character set/DOS CP865.h +159 -0
  60. data/src/external/Z/API/Z/formats/character set/DOS CP866.h +159 -0
  61. data/src/external/Z/API/Z/formats/character set/DOS CP869.h +159 -0
  62. data/src/external/Z/API/Z/formats/character set/DOS CP872.h +159 -0
  63. data/src/external/Z/API/Z/formats/character set/DOS CP874.h +159 -0
  64. data/src/external/Z/API/Z/formats/character set/Unicode.h +30119 -0
  65. data/src/external/Z/API/Z/formats/data model/I16LP32.h +19 -0
  66. data/src/external/Z/API/Z/formats/data model/ILP32.h +19 -0
  67. data/src/external/Z/API/Z/formats/data model/ILP64.h +19 -0
  68. data/src/external/Z/API/Z/formats/data model/IP16L32.h +19 -0
  69. data/src/external/Z/API/Z/formats/data model/LLP64.h +19 -0
  70. data/src/external/Z/API/Z/formats/data model/LP32.h +19 -0
  71. data/src/external/Z/API/Z/formats/data model/LP64.h +19 -0
  72. data/src/external/Z/API/Z/formats/data model/SILP64.h +19 -0
  73. data/src/external/Z/API/Z/formats/file system/FAT12.h +61 -0
  74. data/src/external/Z/API/Z/formats/floating-point/IEEE 754.h +141 -0
  75. data/src/external/Z/API/Z/formats/floating-point/x87.h +74 -0
  76. data/src/external/Z/API/Z/formats/image/ICNS.h +39 -0
  77. data/src/external/Z/API/Z/formats/keymap/Mac OS.h +284 -0
  78. data/src/external/Z/API/Z/formats/keymap/Z.h +141 -0
  79. data/src/external/Z/API/Z/formats/multimedia/Creative Voice.h +106 -0
  80. data/src/external/Z/API/Z/formats/multimedia/Microsoft Wave.h +49 -0
  81. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ACH.h +44 -0
  82. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/FRZ.h +54 -0
  83. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/PRG.h +33 -0
  84. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SEM.h +46 -0
  85. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SIT.h +34 -0
  86. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNA.h +117 -0
  87. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SNP.h +37 -0
  88. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/SP.h +62 -0
  89. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/Z80.h +117 -0
  90. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX.h +56 -0
  91. data/src/external/Z/API/Z/formats/snapshot/machine/computer/ZX Spectrum/ZX82.h +70 -0
  92. data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/UNIF.h +26 -0
  93. data/src/external/Z/API/Z/formats/storage medium image/NES Game Pak/iNES.h +76 -0
  94. data/src/external/Z/API/Z/formats/storage medium image/audio/TAP.h +25 -0
  95. data/src/external/Z/API/Z/formats/storage medium image/audio/TZX.h +1185 -0
  96. data/src/external/Z/API/Z/formats/storage medium image/audio/Warajevo TAP.h +32 -0
  97. data/src/external/Z/API/Z/formats/storage medium image/floppy disk/FDI.h +45 -0
  98. data/src/external/Z/API/Z/functions/base/Z2D.h +583 -0
  99. data/src/external/Z/API/Z/functions/base/Z3D.h +712 -0
  100. data/src/external/Z/API/Z/functions/base/ZRange.h +137 -0
  101. data/src/external/Z/API/Z/functions/base/all.h +16 -0
  102. data/src/external/Z/API/Z/functions/base/casting.hpp +37 -0
  103. data/src/external/Z/API/Z/functions/base/character.h +38 -0
  104. data/src/external/Z/API/Z/functions/base/constructors.h +326 -0
  105. data/src/external/Z/API/Z/functions/base/structure.hpp +26 -0
  106. data/src/external/Z/API/Z/functions/base/type.hpp +60 -0
  107. data/src/external/Z/API/Z/functions/base/value.h +1901 -0
  108. data/src/external/Z/API/Z/functions/base/value.hpp +112 -0
  109. data/src/external/Z/API/Z/functions/buffering/ZRingBuffer.h +85 -0
  110. data/src/external/Z/API/Z/functions/buffering/ZTripleBuffer.h +65 -0
  111. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z2DLine.h +179 -0
  112. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/Z3DLine.h +168 -0
  113. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABB.h +361 -0
  114. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZAABR.h +1081 -0
  115. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZBox.h +340 -0
  116. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZCircle.h +142 -0
  117. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZRectangle.h +1267 -0
  118. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/ZSphere.h +156 -0
  119. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/all.h +18 -0
  120. data/src/external/Z/API/Z/functions/mathematics/geometry/euclidean/constructors.h +620 -0
  121. data/src/external/Z/API/Z/functions/time/date.h +29 -0
  122. data/src/external/Z/API/Z/hardware/CPU/architecture/6502.h +90 -0
  123. data/src/external/Z/API/Z/hardware/CPU/architecture/Z80.h +245 -0
  124. data/src/external/Z/API/Z/hardware/CPU/architecture/i4004.h +37 -0
  125. data/src/external/Z/API/Z/hardware/PSG/General Instrument/AY-3-891x.h +180 -0
  126. data/src/external/Z/API/Z/hardware/VDC/Ricoh/RP2C0x.h +625 -0
  127. data/src/external/Z/API/Z/hardware/bus/AGP.h +24 -0
  128. data/src/external/Z/API/Z/hardware/bus/USB.h +510 -0
  129. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Inves Spectrum +.h +47 -0
  130. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Pentagon.h +13 -0
  131. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/Scorpion.h +13 -0
  132. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum + 128K.h +158 -0
  133. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +.h +82 -0
  134. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2.h +13 -0
  135. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +2A.h +13 -0
  136. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum +3.h +13 -0
  137. data/src/external/Z/API/Z/hardware/machine/model/computer/ZX Spectrum/ZX Spectrum.h +109 -0
  138. data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (NTSC).h +29 -0
  139. data/src/external/Z/API/Z/hardware/machine/model/console/Nintendo Entertainment System/NES-001 (PAL).h +29 -0
  140. data/src/external/Z/API/Z/hardware/machine/platform/computer/ZX Spectrum.h +405 -0
  141. data/src/external/Z/API/Z/hardware/machine/platform/console/Game Boy.h +49 -0
  142. data/src/external/Z/API/Z/hardware/machine/platform/console/Nintendo Entertainment System.h +350 -0
  143. data/src/external/Z/API/Z/hardware/storage medium/ROM cartridge/SNES Game Pak.h +238 -0
  144. data/src/external/Z/API/Z/inspection/C/completion.h +178 -0
  145. data/src/external/Z/API/Z/inspection/C/modules/C11.h +41 -0
  146. data/src/external/Z/API/Z/inspection/C/modules/C18.h +13 -0
  147. data/src/external/Z/API/Z/inspection/C/modules/C89.h +19 -0
  148. data/src/external/Z/API/Z/inspection/C/modules/C90.h +13 -0
  149. data/src/external/Z/API/Z/inspection/C/modules/C94.h +15 -0
  150. data/src/external/Z/API/Z/inspection/C/modules/C99.h +29 -0
  151. data/src/external/Z/API/Z/inspection/C/modules/KR C.h +19 -0
  152. data/src/external/Z/API/Z/inspection/C++/completion.h +512 -0
  153. data/src/external/Z/API/Z/inspection/C++/modules/C++03.h +15 -0
  154. data/src/external/Z/API/Z/inspection/C++/modules/C++11.h +80 -0
  155. data/src/external/Z/API/Z/inspection/C++/modules/C++14.h +26 -0
  156. data/src/external/Z/API/Z/inspection/C++/modules/C++17.h +55 -0
  157. data/src/external/Z/API/Z/inspection/C++/modules/C++85.h +11 -0
  158. data/src/external/Z/API/Z/inspection/C++/modules/C++89.h +13 -0
  159. data/src/external/Z/API/Z/inspection/C++/modules/C++98.h +17 -0
  160. data/src/external/Z/API/Z/inspection/C++.h +78 -0
  161. data/src/external/Z/API/Z/inspection/C.h +79 -0
  162. data/src/external/Z/API/Z/inspection/CPU/completion.h +56 -0
  163. data/src/external/Z/API/Z/inspection/CPU/detection.h +714 -0
  164. data/src/external/Z/API/Z/inspection/CPU/modules/6502.h +25 -0
  165. data/src/external/Z/API/Z/inspection/CPU/modules/AArch32.h +32 -0
  166. data/src/external/Z/API/Z/inspection/CPU/modules/AArch64.h +32 -0
  167. data/src/external/Z/API/Z/inspection/CPU/modules/Z80.h +26 -0
  168. data/src/external/Z/API/Z/inspection/CPU/modules/x86-32.h +31 -0
  169. data/src/external/Z/API/Z/inspection/CPU/modules/x86-64.h +312 -0
  170. data/src/external/Z/API/Z/inspection/CPU.h +209 -0
  171. data/src/external/Z/API/Z/inspection/OS/completion.h +36 -0
  172. data/src/external/Z/API/Z/inspection/OS/detection.h +768 -0
  173. data/src/external/Z/API/Z/inspection/OS/modules/Linux.h +22 -0
  174. data/src/external/Z/API/Z/inspection/OS/modules/MS-DOS.h +16 -0
  175. data/src/external/Z/API/Z/inspection/OS/modules/Mac OS X.h +23 -0
  176. data/src/external/Z/API/Z/inspection/OS/modules/Windows.h +19 -0
  177. data/src/external/Z/API/Z/inspection/OS/modules/iPhone OS.h +23 -0
  178. data/src/external/Z/API/Z/inspection/OS.h +236 -0
  179. data/src/external/Z/API/Z/inspection/Objective-C/completion.h +8 -0
  180. data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v1.0.h +11 -0
  181. data/src/external/Z/API/Z/inspection/Objective-C/modules/Objective-C v2.0.h +15 -0
  182. data/src/external/Z/API/Z/inspection/Objective-C.h +51 -0
  183. data/src/external/Z/API/Z/inspection/Z.h +19 -0
  184. data/src/external/Z/API/Z/inspection/build.h +22 -0
  185. data/src/external/Z/API/Z/inspection/character set.h +66 -0
  186. data/src/external/Z/API/Z/inspection/compiler/completion.h +2885 -0
  187. data/src/external/Z/API/Z/inspection/compiler/modules/Apple LLVM.h +26 -0
  188. data/src/external/Z/API/Z/inspection/compiler/modules/Clang.h +1664 -0
  189. data/src/external/Z/API/Z/inspection/compiler/modules/GCC.h +1366 -0
  190. data/src/external/Z/API/Z/inspection/compiler/modules/SCCZ80.h +473 -0
  191. data/src/external/Z/API/Z/inspection/compiler/modules/Visual C++.h +606 -0
  192. data/src/external/Z/API/Z/inspection/compiler/modules/cc65.h +529 -0
  193. data/src/external/Z/API/Z/inspection/compiler/modules/generic.h +13 -0
  194. data/src/external/Z/API/Z/inspection/compiler/modules/template.h +650 -0
  195. data/src/external/Z/API/Z/inspection/compiler.h +299 -0
  196. data/src/external/Z/API/Z/inspection/data model/completion.h +128 -0
  197. data/src/external/Z/API/Z/inspection/data model/deduction.h +9 -0
  198. data/src/external/Z/API/Z/inspection/data model/detection.h +45 -0
  199. data/src/external/Z/API/Z/inspection/data model.h +362 -0
  200. data/src/external/Z/API/Z/inspection/floating-point/completion.h +50 -0
  201. data/src/external/Z/API/Z/inspection/floating-point.h +324 -0
  202. data/src/external/Z/API/Z/inspection/language.h +163 -0
  203. data/src/external/Z/API/Z/inspection/platform/detection.h +9 -0
  204. data/src/external/Z/API/Z/inspection/platform.h +29 -0
  205. data/src/external/Z/API/Z/keys/C++.h +27 -0
  206. data/src/external/Z/API/Z/keys/C.h +29 -0
  207. data/src/external/Z/API/Z/keys/CPU.h +80 -0
  208. data/src/external/Z/API/Z/keys/OS.h +182 -0
  209. data/src/external/Z/API/Z/keys/Objective-C.h +17 -0
  210. data/src/external/Z/API/Z/keys/chemistry.h +26 -0
  211. data/src/external/Z/API/Z/keys/compiler.h +178 -0
  212. data/src/external/Z/API/Z/keys/data model.h +32 -0
  213. data/src/external/Z/API/Z/keys/endianness.h +24 -0
  214. data/src/external/Z/API/Z/keys/language.h +21 -0
  215. data/src/external/Z/API/Z/keys/layout.h +20 -0
  216. data/src/external/Z/API/Z/keys/mathematics/geometry.h +29 -0
  217. data/src/external/Z/API/Z/keys/mathematics/number.h +21 -0
  218. data/src/external/Z/API/Z/keys/order.h +18 -0
  219. data/src/external/Z/API/Z/keys/platform.h +87 -0
  220. data/src/external/Z/API/Z/keys/program.h +39 -0
  221. data/src/external/Z/API/Z/keys/science/chemical elements.h +200 -0
  222. data/src/external/Z/API/Z/keys/science/electricity.h +18 -0
  223. data/src/external/Z/API/Z/keys/science/magnetism.h +19 -0
  224. data/src/external/Z/API/Z/keys/status.h +69 -0
  225. data/src/external/Z/API/Z/keys/text.h +27 -0
  226. data/src/external/Z/API/Z/keys/value.h +88 -0
  227. data/src/external/Z/API/Z/macros/arguments.h +25 -0
  228. data/src/external/Z/API/Z/macros/casting.h +22 -0
  229. data/src/external/Z/API/Z/macros/character.h +159 -0
  230. data/src/external/Z/API/Z/macros/date.h +14 -0
  231. data/src/external/Z/API/Z/macros/key.h +20 -0
  232. data/src/external/Z/API/Z/macros/language.h +126 -0
  233. data/src/external/Z/API/Z/macros/language.hpp +81 -0
  234. data/src/external/Z/API/Z/macros/members.h +86 -0
  235. data/src/external/Z/API/Z/macros/pasting.h +308 -0
  236. data/src/external/Z/API/Z/macros/pointer.h +33 -0
  237. data/src/external/Z/API/Z/macros/repetition.h +283 -0
  238. data/src/external/Z/API/Z/macros/structure.h +104 -0
  239. data/src/external/Z/API/Z/macros/templating.h +407 -0
  240. data/src/external/Z/API/Z/macros/tokens.h +14 -0
  241. data/src/external/Z/API/Z/macros/type enumeration.h +43 -0
  242. data/src/external/Z/API/Z/macros/type selection.hpp +76 -0
  243. data/src/external/Z/API/Z/macros/value.h +489 -0
  244. data/src/external/Z/API/Z/macros/variadic pasting.h +21 -0
  245. data/src/external/Z/API/Z/macros/variadic selection.h +56 -0
  246. data/src/external/Z/API/Z/macros/variadic.h +46 -0
  247. data/src/external/Z/API/Z/macros/version.h +17 -0
  248. data/src/external/Z/API/Z/network/3/IP.h +36 -0
  249. data/src/external/Z/API/Z/network/4/TCP.h +24 -0
  250. data/src/external/Z/API/Z/network/4/UDP.h +26 -0
  251. data/src/external/Z/API/Z/network/7/ED2K.h +104 -0
  252. data/src/external/Z/API/Z/network/7/HTTP.h +100 -0
  253. data/src/external/Z/API/Z/traits/SelectType.hpp +71 -0
  254. data/src/external/Z/API/Z/traits/TernaryType.hpp +20 -0
  255. data/src/external/Z/API/Z/traits/Type.hpp +4516 -0
  256. data/src/external/Z/API/Z/traits/TypeCount.hpp +52 -0
  257. data/src/external/Z/API/Z/traits/TypeList.hpp +376 -0
  258. data/src/external/Z/API/Z/traits/base.hpp +19 -0
  259. data/src/external/Z/API/Z/traits/filtering.hpp +30 -0
  260. data/src/external/Z/API/Z/traits/mathematics.hpp +48 -0
  261. data/src/external/Z/API/Z/types/arguments.h +19 -0
  262. data/src/external/Z/API/Z/types/base.h +1655 -0
  263. data/src/external/Z/API/Z/types/base.hpp +169 -0
  264. data/src/external/Z/API/Z/types/buffering.h +27 -0
  265. data/src/external/Z/API/Z/types/mathematics.h +135 -0
  266. data/src/external/Z/API/Z/types/time.h +23 -0
  267. data/src/external/Z/COPYING.LESSER +165 -0
  268. data/src/external/Z/development/Qt Creator/Z.pro +253 -0
  269. data/src/external/Z/distribution/CocoaPods/Zeta.podspec +18 -0
  270. data/src/external/Z/distribution/Gentoo Linux/Zeta-0.1.ebuild +22 -0
  271. data/src/external/Z/distribution/Gentoo Linux/metadata.xml +8 -0
  272. data/src/external/Z/distribution/Homebrew/Zeta.rb +11 -0
  273. data/src/external/z80/API/emulation/CPU/Z80.h +201 -0
  274. data/src/external/z80/README.md +229 -0
  275. data/src/external/z80/building/premake4.lua +33 -0
  276. data/src/external/z80/development/Xcode/Z80.xcodeproj/project.pbxproj +520 -0
  277. data/src/external/z80/sources/Z80.c +1660 -0
  278. data/src/interrupt.c +6 -0
  279. data/src/interrupt.h +3 -0
  280. data/src/io.c.erb +115 -0
  281. data/src/io.h.erb +18 -0
  282. data/src/main.c +69 -0
  283. data/src/memory.c.erb +43 -0
  284. data/src/memory.h.erb +9 -0
  285. metadata +329 -0
@@ -0,0 +1,1366 @@
1
+ /* Z Kit - inspection/modules/compiler/GCC.h
2
+ _____ _______________
3
+ /_ /_/ -_/_ _/ _ |
4
+ /____/\___/ /__//___/_| Kit
5
+ Copyright (C) 2006-2018 Manuel Sainz de Baranda y Goñi.
6
+ Released under the terms of the GNU Lesser General Public License v3. */
7
+
8
+ #ifndef _Z_inspection_modules_compiler_GCC_H_
9
+ #define _Z_inspection_modules_compiler_GCC_H_
10
+
11
+ #include <Z/macros/version.h>
12
+ #include <Z/keys/order.h>
13
+
14
+ /* MARK: - Identification */
15
+
16
+ #define Z_COMPILER Z_COMPILER_GCC
17
+ #define Z_COMPILER_STRING Z_COMPILER_STRING_GCC
18
+ #define Z_COMPILER_VERSION Z_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)
19
+ #define Z_COMPILER_VERSION_STRING __VERSION__
20
+
21
+ /* MARK: - Bit field order */
22
+
23
+ /* MARK: - OS */
24
+
25
+ #if defined(__gnu_linux) || \
26
+ defined(__linux ) || \
27
+ defined(__linux__ ) || \
28
+ defined(linux )
29
+
30
+ # define Z_COMPILER_OS Z_OS_LINUX
31
+
32
+ #elif defined(__FreeBSD__)
33
+ # define Z_COMPILER_OS Z_OS_FREE_BSD
34
+
35
+ #elif defined(__NetBSD__)
36
+ # define Z_COMPILER_OS Z_OS_NET_BSD
37
+
38
+ #elif defined(__OpenBSD__)
39
+ # define Z_COMPILER_OS Z_OS_OPEN_BSD
40
+
41
+ #elif defined(__WIN32 ) || \
42
+ defined(__WIN32__) || \
43
+ defined(__WIN64 ) || \
44
+ defined(__WIN64__) || \
45
+ defined(__WINNT ) || \
46
+ defined(__WINNT__) || \
47
+ defined(_WIN32 ) || \
48
+ defined(_WIN64 ) || \
49
+ defined(WIN32 ) || \
50
+ defined(WIN64 ) || \
51
+ defined(WINNT )
52
+
53
+ # define Z_COMPILER_OS Z_OS_WINDOWS
54
+
55
+ #elif defined(_AIX)
56
+ # define Z_COMPILER_OS Z_OS_AIX
57
+
58
+ #elif defined(__amigaos__)
59
+ # define Z_COMPILER_OS Z_OS_AMIGA_OS
60
+
61
+ #elif defined(__bg__)
62
+ # define Z_COMPILER_OS Z_OS_BLUE_GENE
63
+
64
+ #elif defined(__hpux) || defined(hpux)
65
+ # define Z_COMPILER_OS Z_OS_HP_UX
66
+
67
+ #elif defined(__netware__)
68
+ # define Z_COMPILER_OS Z_OS_NETWARE
69
+
70
+ #elif defined(__palmos__)
71
+ # define Z_COMPILER_OS Z_OS_PALM_OS
72
+
73
+ #elif defined(M_XENIX)
74
+ # define Z_COMPILER_OS Z_OS_SCO_UNIX_SYSTEM_V
75
+
76
+ #elif defined(__sun ) || \
77
+ defined(__sun__) || \
78
+ defined(sun )
79
+
80
+ # if defined(__svr4__) || \
81
+ defined(__SVR4 )
82
+
83
+ # define Z_COMPILER_OS Z_COMPILER_OS_SOLARIS
84
+ # else
85
+ # define Z_COMPILER_OS Z_COMPILER_OS_SUN_OS
86
+ # endif
87
+
88
+ #elif defined(__vxworks ) || \
89
+ defined(__VXWORKS__)
90
+
91
+ # define Z_COMPILER_OS Z_OS_VX_WORKS
92
+
93
+ #endif
94
+
95
+ /* MARK: - CPU */
96
+
97
+ #if defined(__amd64 ) || \
98
+ defined(__amd64__ ) || \
99
+ defined(__x86_64 ) || \
100
+ defined(__x86_64__) || \
101
+ defined(_M_AMD64 ) || \
102
+ defined(_M_X64 )
103
+
104
+ # define Z_COMPILER_CPU_ARCHITECTURE Z_CPU_ARCHITECTURE_X86_64
105
+
106
+ #elif defined(__386__ ) || \
107
+ defined(__i386 ) || \
108
+ defined(__i386__) || \
109
+ defined(_M_IX86 ) || \
110
+ defined(i386 )
111
+
112
+ # define Z_COMPILER_CPU_ARCHITECTURE Z_CPU_ARCHITECTURE_X86_32
113
+
114
+ #endif
115
+
116
+ /* MARK: - Endianness and Bit field order */
117
+
118
+ #ifdef __BYTE_ORDER__
119
+
120
+ # if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
121
+ # define Z_COMPILER_CPU_INTEGER_ENDIANNESS Z_ENDIANNESS_LITTLE
122
+ # define Z_COMPILER_BIT_FIELD_ORDER Z_ORDER_REVERSED
123
+
124
+ # elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
125
+ # define Z_COMPILER_CPU_INTEGER_ENDIANNESS Z_ENDIANNESS_BIG
126
+ # define Z_COMPILER_BIT_FIELD_ORDER Z_ORDER_NORMAL
127
+
128
+ # elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
129
+ # define Z_COMPILER_CPU_INTEGER_ENDIANNESS Z_ENDIANNESS_PDP
130
+ # define Z_COMPILER_BIT_FIELD_ORDER Z_ORDER_NORMAL
131
+ # endif
132
+
133
+ #endif
134
+
135
+ /*#define Z_COMPIER_INTEGER_ENDIANNESS_8BIT*/
136
+ /*#define Z_COMPIER_INTEGER_ENDIANNESS_16BIT*/
137
+ /*#define Z_COMPIER_INTEGER_ENDIANNESS_32BIT*/
138
+ /*#define Z_COMPIER_INTEGER_ENDIANNESS_64BIT*/
139
+ /*#define Z_COMPIER_INTEGER_ENDIANNESS_128BIT*/
140
+ /*#define Z_COMPILER_BIT_FIELD_ORDER_8BIT*/
141
+ /*#define Z_COMPILER_BIT_FIELD_ORDER_16BIT*/
142
+ /*#define Z_COMPILER_BIT_FIELD_ORDER_32BIT*/
143
+ /*#define Z_COMPILER_BIT_FIELD_ORDER_64BIT*/
144
+ /*#define Z_COMPILER_BIT_FIELD_ORDER_128BIT*/
145
+
146
+ /* MARK: - Data model */
147
+
148
+ #if defined(__LP64__) || defined(_LP64)
149
+ # define Z_COMPILER_DATA_MODEL Z_DATA_MODEL_LP64
150
+
151
+ #elif defined(_WIN64)
152
+ # define Z_COMPILER_DATA_MODEL Z_DATA_MODEL_LLP64
153
+
154
+ #elif defined(__ILP32__) || defined(_ILP32) || defined(_WIN32)
155
+ # define Z_COMPILER_DATA_MODEL Z_DATA_MODEL_ILP32
156
+ #endif
157
+
158
+ /* MARK: - K&R C support */
159
+
160
+ #define Z_COMPILER_C_HAS_OPERATOR_SIZE_OF TRUE
161
+ #define Z_COMPILER_C_HAS_STORAGE_CLASS_AUTO TRUE
162
+ #define Z_COMPILER_C_HAS_STORAGE_CLASS_EXTERN TRUE
163
+ #define Z_COMPILER_C_HAS_STORAGE_CLASS_REGISTER TRUE
164
+ #define Z_COMPILER_C_HAS_STORAGE_CLASS_STATIC TRUE
165
+ #define Z_COMPILER_C_HAS_TYPE_FLOAT TRUE
166
+ #define Z_COMPILER_C_HAS_TYPE_DOUBLE TRUE
167
+
168
+ /* MARK: - C89 support */
169
+
170
+ #define Z_COMPILER_C_HAS_ENUMERATION TRUE
171
+ #define Z_COMPILER_C_HAS_VOID_POINTER TRUE
172
+ #define Z_COMPILER_C_HAS_TYPE_LDOUBLE TRUE
173
+ #define Z_COMPILER_C_HAS_TYPE_QUALIFIER_CONSTANT TRUE
174
+ #define Z_COMPILER_C_HAS_TYPE_QUALIFIER_VOLATILE TRUE
175
+
176
+ /* MARK: - C90 support */
177
+
178
+ /* MARK: - C94 support */
179
+
180
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 7, 0)
181
+ # define Z_COMPILER_C_HAS_DIGRAPHS TRUE
182
+ #endif
183
+
184
+ /* MARK: - C99 support
185
+ .---------------------------------------------------------------------------.
186
+ | GCC implements several features of C99 as extensions in C90 and in C++98, |
187
+ | but some of them generate warnings with "-pedantic" when compiling using |
188
+ | a standard previous to C99. |
189
+ | Reference: http://gcc.gnu.org/c99status.html |
190
+ '--------------------------------------------------------------------------*/
191
+
192
+ #if Z_COMPILER_VERSION >= Z_VERSION(1, 21, 0)
193
+ # define Z_COMPILER_C_HAS_INLINE_FUNCION TRUE
194
+ #endif
195
+
196
+ #if defined(__UINTMAX_MAX__) && 0U - 1U == __UINTMAX_MAX__
197
+ # define Z_COMPILER_C_HAS_PREPROCESSOR_ARITHMETIC_DONE_IN_MAXIMUM_INTEGRAL TRUE
198
+ #endif
199
+
200
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 95, 0)
201
+ # define Z_COMPILER_C_HAS_TYPE_QUALIFIER_RESTRICT TRUE
202
+ #endif
203
+
204
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
205
+
206
+ # if /*Z_COMPILER_VERSION >= Z_VERSION(0, 9, 0) &&*/ !defined(__STDC_NO_VLA__)
207
+ # define Z_COMPILER_C_HAS_VLA TRUE
208
+ # endif
209
+
210
+ # if Z_COMPILER_VERSION >= Z_VERSION(3, 0, 0)
211
+ # define Z_COMPILER_C_HAS_DESIGNATED_INITIALIZER TRUE
212
+ # define Z_COMPILER_C_HAS_FLEXIBLE_ARRAY_MEMBER TRUE
213
+ # endif
214
+
215
+ # if Z_COMPILER_VERSION >= Z_VERSION(3, 1, 0)
216
+ # define Z_COMPILER_C_HAS_COMPOUND_LITERAL TRUE
217
+ # endif
218
+
219
+ #endif
220
+
221
+ #if defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
222
+
223
+ # if Z_COMPILER_VERSION >= Z_VERSION(2, 7, 0)
224
+ # define Z_COMPILER_C_HAS_CPP_STYLE_COMMENT TRUE
225
+ # endif
226
+
227
+ # if Z_COMPILER_VERSION >= Z_VERSION(3, 0, 0)
228
+ # define Z_COMPILER_C_HAS_MIXED_DECLARATIONS_AND_CODE TRUE
229
+ # endif
230
+
231
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 3, 0)
232
+ # define Z_COMPILER_C_HAS_SPECIFIER_INLINE TRUE
233
+ # endif
234
+
235
+ #endif
236
+
237
+ #if (defined(__cplusplus) && __cplusplus >= 201103L) || \
238
+ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
239
+
240
+ # if Z_COMPILER_VERSION >= Z_VERSION(1, 27, 0) && !defined(__DARWIN_NO_LONG_LONG)
241
+ # define Z_COMPILER_C_HAS_TYPE_ULLONG TRUE
242
+ # define Z_COMPILER_C_HAS_TYPE_LLONG TRUE
243
+ # endif
244
+
245
+ # if Z_COMPILER_VERSION >= Z_VERSION(2, 95, 0)
246
+ # define Z_COMPILER_C_HAS_VARIADIC_MACRO TRUE
247
+ # endif
248
+
249
+ # if !defined(Z_COMPILER_C_HAS_PREPROCESSOR_ARITHMETIC_DONE_IN_MAXIMUM_INTEGRAL) && \
250
+ Z_COMPILER_VERSION >= Z_VERSION(3, 3, 0)
251
+
252
+ # define Z_COMPILER_C_HAS_PREPROCESSOR_ARITHMETIC_DONE_IN_MAXIMUM_INTEGRAL TRUE
253
+ # endif
254
+
255
+ #endif
256
+
257
+ /* MARK: - C11 support
258
+ .----------------------------------------------.
259
+ | Reference: http://gcc.gnu.org/wiki/C11Status |
260
+ '---------------------------------------------*/
261
+
262
+ #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
263
+
264
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 6, 0)
265
+ # define Z_COMPILER_C_HAS_ANONYMOUS_STRUCTURE TRUE
266
+ # define Z_COMPILER_C_HAS_STATIC_ASSERTION TRUE
267
+
268
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 7, 0)
269
+ # define Z_COMPILER_C_HAS_OPERATOR_ALIGN_OF TRUE
270
+ # define Z_COMPILER_C_HAS_SPECIFIER_ALIGN_AS TRUE
271
+ # define Z_COMPILER_C_HAS_SPECIFIER_NO_RETURN TRUE
272
+
273
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 9, 0)
274
+ # define Z_COMPILER_C_HAS_GENERIC_SELECTION TRUE
275
+ # define Z_COMPILER_C_HAS_STORATE_CLASS_THREAD_LOCAL TRUE
276
+
277
+ # ifndef __STDC_NO_ATOMICS__
278
+ # define Z_COMPILER_C_HAS_ATOMIC_OPERATIONS TRUE
279
+ # define Z_COMPILER_C_HAS_SPECIFIER_ATOMIC TRUE
280
+ # define Z_COMPILER_C_HAS_TYPE_QUALIFIER_ATOMIC TRUE
281
+ # endif
282
+ # endif
283
+ # endif
284
+ # endif
285
+ #endif
286
+
287
+ #if Z_COMPILER_VERSION >= Z_VERSION(4, 6, 0) && \
288
+ (defined(__cplusplus) || defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
289
+
290
+ # define Z_COMPILER_C_HAS_ANONYMOUS_UNION TRUE
291
+ #endif
292
+
293
+ /* MARK: - C18 support */
294
+
295
+ /* MARK: - Apple C extensions support */
296
+
297
+ #ifdef __BLOCKS__
298
+ # define Z_COMPILER_C_HAS_CLOSURE TRUE
299
+ #endif
300
+
301
+ #if defined(__cplusplus)
302
+
303
+ /* MARK: - C++98 support */
304
+
305
+ # if __cplusplus >= 199711L
306
+ # define Z_COMPILER_CPP_HAS_SFINAE TRUE /* TODO: from version...? */
307
+ # define Z_COMPILER_CPP_HAS_TYPE_BOOLEAN TRUE /* TODO: from version...? */
308
+ # endif
309
+
310
+ /* MARK: - C++11 support */
311
+
312
+ # if __cplusplus >= 201103L
313
+
314
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 3, 0)
315
+ # define Z_COMPILER_CPP_HAS_C99_PREPROCESSOR TRUE
316
+ # define Z_COMPILER_CPP_HAS_CONCURRENT_STATIC_LOCAL_VARIABLE TRUE
317
+ # define Z_COMPILER_CPP_HAS_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATE TRUE
318
+ # define Z_COMPILER_CPP_HAS_RVALUE_REFERENCE TRUE
319
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_DECLARED_TYPE TRUE
320
+ # define Z_COMPILER_CPP_HAS_VARIADIC_TEMPLATE TRUE
321
+ # define Z_COMPILER_CPP_HAS_TYPE_ULLONG TRUE
322
+ # define Z_COMPILER_CPP_HAS_TYPE_LLONG TRUE
323
+
324
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 4, 0)
325
+ # define Z_COMPILER_CPP_HAS_COPY_LIST_INITIALIZATION TRUE
326
+ # define Z_COMPILER_CPP_HAS_DIRECT_LIST_INITIALIZATION TRUE
327
+ # define Z_COMPILER_CPP_HAS_INITIALIZER_LIST TRUE
328
+ # define Z_COMPILER_CPP_HAS_STRONGLY_TYPED_ENUMERATION TRUE
329
+ # define Z_COMPILER_CPP_HAS_TRAILING_RETURN_TYPE TRUE
330
+ # define Z_COMPILER_CPP_HAS_VARIADIC_TEMPLATE_EXTENDED_PARAMETERS TRUE
331
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_AUTO TRUE
332
+
333
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 5, 0)
334
+ # define Z_COMPILER_CPP_HAS_EXPLICIT_CONVERSION TRUE
335
+ # define Z_COMPILER_CPP_HAS_EXPRESSION_SFINAE TRUE
336
+ # define Z_COMPILER_CPP_HAS_LAMBDA TRUE
337
+ # define Z_COMPILER_CPP_HAS_OPERATOR_ALIGN_OF TRUE
338
+
339
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 6, 0)
340
+ # define Z_COMPILER_CPP_HAS_RANGE_BASED_FOR TRUE
341
+ # define Z_COMPILER_CPP_HAS_UNRESTRICTED_UNION TRUE
342
+ # define Z_COMPILER_CPP_HAS_MOVE_SPECIAL_MEMBER_FUNCTIONS TRUE
343
+ # define Z_COMPILER_CPP_HAS_LITERAL_NULL_POINTER TRUE
344
+ # define Z_COMPILER_CPP_HAS_OPERATOR_NO_EXCEPTION TRUE
345
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_CONSTANT_EXPRESSION TRUE
346
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_NO_EXCEPTION TRUE
347
+
348
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 7, 0)
349
+ # define Z_COMPILER_CPP_HAS_DEFAULT_MEMBER_INITIALIZER TRUE
350
+ # define Z_COMPILER_CPP_HAS_TEMPLATE_ALIAS TRUE
351
+
352
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 8, 0)
353
+ # define Z_COMPILER_CPP_HAS_INHERITING_CONSTRUCTORS TRUE
354
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_ALIGN_AS TRUE
355
+
356
+ # if Z_COMPILER_VERSION >= Z_VERSION(4, 8 ,1)
357
+ # define Z_COMPILER_CPP_HAS_REFERENCE_QUALIFIED_NON_STATIC_MEMBER_FUNCTION TRUE
358
+ # define Z_COMPILER_CPP_HAS_SPECIFIER_DECLARED_TYPE_OF_INCOMPLETE_RETURN TRUE
359
+ # endif
360
+ # endif
361
+ # endif
362
+ # endif
363
+ # endif
364
+ # endif
365
+ # endif
366
+
367
+ # endif
368
+
369
+ #endif
370
+
371
+ /* MARK: - Attributes
372
+ .---------------------------------------------------------------------------.
373
+ | There is no official documentation where to consult since what version is |
374
+ | available each attribute. The following list has been used as reference: |
375
+ | https://ohse.de/uwe/articles/gcc-attributes.html |
376
+ '--------------------------------------------------------------------------*/
377
+
378
+ /*#define Z_COMPILER_ATTRIBUTE_API_ALIAS*/
379
+ /*#define Z_COMPILER_ATTRIBUTE_API_EXPORT_ALIAS*/
380
+ /*#define Z_COMPILER_ATTRIBUTE_API_WEAK_EXPORT*/
381
+
382
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 3, 0)
383
+ # define Z_COMPILER_ATTRIBUTE_STRICT_SIZE_BEGIN
384
+ # define Z_COMPILER_ATTRIBUTE_STRICT_SIZE_END __attribute__((packed))
385
+ #endif
386
+
387
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 5, 0)
388
+ # define Z_COMPILER_ATTRIBUTE_NO_RETURN __attribute__((noreturn))
389
+ #endif
390
+
391
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 7, 0)
392
+ # define Z_COMPILER_ATTRIBUTE_ALIAS(name) __attribute__((alias(name)))
393
+ # define Z_COMPILER_ATTRIBUTE_WEAK __attribute__((weak))
394
+ #endif
395
+
396
+ #if Z_COMPILER_VERSION >= Z_VERSION(2, 8, 0) && \
397
+ defined(Z_COMPILER_OS) && Z_COMPILER_OS == Z_OS_WINDOWS
398
+
399
+ # define Z_COMPILER_ATTRIBUTE_API __attribute__((dllimport))
400
+ # define Z_COMPILER_ATTRIBUTE_API_EXPORT __attribute__((dllexport))
401
+ #endif
402
+
403
+ #if Z_COMPILER_VERSION >= Z_VERSION(3, 1, 0)
404
+ # define Z_COMPILER_ATTRIBUTE_INLINE __inline__ __attribute__((always_inline))
405
+
406
+ #elif Z_COMPILER_VERSION >= Z_VERSION(1, 21, 0)
407
+ # define Z_COMPILER_ATTRIBUTE_INLINE __inline__
408
+ #endif
409
+
410
+ #if Z_COMPILER_VERSION >= Z_VERSION(3, 3, 0)
411
+
412
+ # define Z_COMPILER_ATTRIBUTE_PRIVATE __attribute__((visibility("hidden")))
413
+ # define Z_COMPILER_ATTRIBUTE_PUBLIC __attribute__((visibility("default")))
414
+
415
+ /*----------------------------------------------------------.
416
+ | See: http://gcc.gnu.org/ml/gcc-help/2006-08/msg00232.html |
417
+ '----------------------------------------------------------*/
418
+ # if defined(Z_COMPILER_CPU_ARCHITECTURE) && \
419
+ (Z_COMPILER_CPU_ARCHITECTURE == Z_CPU_ARCHITECTURE_X86_32 || \
420
+ Z_COMPILER_CPU_ARCHITECTURE == Z_CPU_ARCHITECTURE_X86_64)
421
+
422
+ # define Z_COMPILER_ATTRIBUTE_THREAD_LOCAL __thread
423
+ # endif
424
+
425
+ #endif
426
+
427
+ /*----------------------------------------------------------------------.
428
+ | "sentinel" first appeared in the documentation of GCC v4.0.0: |
429
+ | https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html |
430
+ '----------------------------------------------------------------------*/
431
+ #if Z_COMPILER_VERSION >= Z_VERSION(4, 0, 0)
432
+ # define Z_COMPILER_ATTRIBUTE_NULL_TERMINATED __attribute__((sentinel))
433
+ #endif
434
+
435
+ /* MARK: - Built-in constants */
436
+
437
+ /*#define Z_COMPILER_CONSTANT_FLOAT16_INFINITY*/
438
+ /*#define Z_COMPILER_CONSTANT_FLOAT16_NAN*/
439
+
440
+ /*#define Z_COMPILER_CONSTANT_FLOAT24_INFINITY*/
441
+ /*#define Z_COMPILER_CONSTANT_FLOAT24_NAN*/
442
+
443
+ /*#define Z_COMPILER_CONSTANT_FLOAT32_INFINITY*/
444
+ /*#define Z_COMPILER_CONSTANT_FLOAT32_NAN*/
445
+
446
+ /*#define Z_COMPILER_CONSTANT_FLOAT48_INFINITY*/
447
+ /*#define Z_COMPILER_CONSTANT_FLOAT48_NAN*/
448
+
449
+ /*#define Z_COMPILER_CONSTANT_FLOAT64_INFINITY*/
450
+ /*#define Z_COMPILER_CONSTANT_FLOAT64_NAN*/
451
+
452
+ /*#define Z_COMPILER_CONSTANT_FLOAT72_INFINITY*/
453
+ /*#define Z_COMPILER_CONSTANT_FLOAT72_NAN*/
454
+
455
+ /*#define Z_COMPILER_CONSTANT_FLOAT80_INFINITY*/
456
+ /*#define Z_COMPILER_CONSTANT_FLOAT80_NAN*/
457
+
458
+ /*#define Z_COMPILER_CONSTANT_FLOAT96_INFINITY*/
459
+ /*#define Z_COMPILER_CONSTANT_FLOAT96_NAN*/
460
+
461
+ /*#define Z_COMPILER_CONSTANT_FLOAT128_INFINITY*/
462
+ /*#define Z_COMPILER_CONSTANT_FLOAT128_NAN*/
463
+
464
+ #ifdef __CHAR_BIT__
465
+ # define Z_COMPILER_CONSTANT_UCHAR_BITS __CHAR_BIT__
466
+ # define Z_COMPILER_CONSTANT_UCHAR_SIZE (__CHAR_BIT__ / 8)
467
+ # define Z_COMPILER_CONSTANT_CHAR_BITS __CHAR_BIT__
468
+ # define Z_COMPILER_CONSTANT_CHAR_SIZE (__CHAR_BIT__ / 8)
469
+ #endif
470
+
471
+ #ifdef __SCHAR_MAX__
472
+ # define Z_COMPILER_CONSTANT_UCHAR_MAXIMUM ( __SCHAR_MAX__ * 2 + 1)
473
+ # define Z_COMPILER_CONSTANT_CHAR_MINIMUM (-__SCHAR_MAX__ - 1)
474
+ # define Z_COMPILER_CONSTANT_CHAR_MAXIMUM __SCHAR_MAX__
475
+ #endif
476
+
477
+ #ifdef __SIZEOF_SHORT__
478
+ # define Z_COMPILER_CONSTANT_USHORT_BITS (__SIZEOF_SHORT__ * 8)
479
+ # define Z_COMPILER_CONSTANT_USHORT_SIZE __SIZEOF_SHORT__
480
+ # define Z_COMPILER_CONSTANT_SHORT_BITS (__SIZEOF_SHORT__ * 8)
481
+ # define Z_COMPILER_CONSTANT_SHORT_SIZE __SIZEOF_SHORT__
482
+ #endif
483
+
484
+ #ifdef __SHRT_MAX__
485
+ # define Z_COMPILER_CONSTANT_USHORT_MAXIMUM ( __SHRT_MAX__ * 2 + 1)
486
+ # define Z_COMPILER_CONSTANT_SHORT_MINIMUM (-__SHRT_MAX__ - 1)
487
+ # define Z_COMPILER_CONSTANT_SHORT_MAXIMUM __SHRT_MAX__
488
+ #endif
489
+
490
+ #ifdef __SIZEOF_INT__
491
+ # define Z_COMPILER_CONSTANT_UINT_BITS (__SIZEOF_INT__ * 8)
492
+ # define Z_COMPILER_CONSTANT_UINT_SIZE __SIZEOF_INT__
493
+ # define Z_COMPILER_CONSTANT_INT_BITS (__SIZEOF_INT__ * 8)
494
+ # define Z_COMPILER_CONSTANT_INT_SIZE __SIZEOF_INT__
495
+ #endif
496
+
497
+ #ifdef __INT_MAX__
498
+ # define Z_COMPILER_CONSTANT_UINT_MAXIMUM ( __INT_MAX__ * 2 + 1)
499
+ # define Z_COMPILER_CONSTANT_INT_MINIMUM (-__INT_MAX__ - 1)
500
+ # define Z_COMPILER_CONSTANT_INT_MAXIMUM __INT_MAX__
501
+ #endif
502
+
503
+ #ifdef __SIZEOF_LONG__
504
+ # define Z_COMPILER_CONSTANT_ULONG_BITS (__SIZEOF_LONG__ * 8)
505
+ # define Z_COMPILER_CONSTANT_ULONG_SIZE __SIZEOF_LONG__
506
+ # define Z_COMPILER_CONSTANT_LONG_BITS (__SIZEOF_LONG__ * 8)
507
+ # define Z_COMPILER_CONSTANT_LONG_SIZE __SIZEOF_LONG__
508
+ #endif
509
+
510
+ /*#define Z_COMPILER_CONSTANT_ULONG_MAXIMUM*/
511
+
512
+ #ifdef __LONG_MAX__
513
+ # define Z_COMPILER_CONSTANT_LONG_MINIMUM (-__LONG_MAX__ - 1L)
514
+ # define Z_COMPILER_CONSTANT_LONG_MAXIMUM __LONG_MAX__
515
+ #endif
516
+
517
+ #ifdef __SIZEOF_LONG_LONG__
518
+ # define Z_COMPILER_CONSTANT_ULLONG_BITS (__SIZEOF_LONG_LONG__ * 8)
519
+ # define Z_COMPILER_CONSTANT_ULLONG_SIZE __SIZEOF_LONG_LONG__
520
+ # define Z_COMPILER_CONSTANT_LLONG_BITS (__SIZEOF_LONG_LONG__ * 8)
521
+ # define Z_COMPILER_CONSTANT_LLONG_SIZE __SIZEOF_LONG_LONG__
522
+ #endif
523
+
524
+ /*#define Z_COMPILER_CONSTANT_ULLONG_MAXIMUM*/
525
+
526
+ #ifdef __LONG_LONG_MAX__
527
+ # define Z_COMPILER_CONSTANT_LLONG_MINIMUM (-__LONG_LONG_MAX__ - 1LL)
528
+ # define Z_COMPILER_CONSTANT_LLONG_MAXIMUM __LONG_LONG_MAX__
529
+ #endif
530
+
531
+ #ifdef __SIZEOF_FLOAT__
532
+ # define Z_COMPILER_CONSTANT_FLOAT_BITS (__SIZEOF_FLOAT__ * 8)
533
+ # define Z_COMPILER_CONSTANT_FLOAT_SIZE __SIZEOF_FLOAT__
534
+ #endif
535
+
536
+ #ifdef __SIZEOF_DOUBLE__
537
+ # define Z_COMPILER_CONSTANT_DOUBLE_BITS (__SIZEOF_DOUBLE__ * 8)
538
+ # define Z_COMPILER_CONSTANT_DOUBLE_SIZE __SIZEOF_DOUBLE__
539
+ #endif
540
+
541
+ #ifdef __SIZEOF_LONG_DOUBLE__
542
+ # define Z_COMPILER_CONSTANT_LDOUBLE_BITS (__SIZEOF_LONG_DOUBLE__ * 8)
543
+ # define Z_COMPILER_CONSTANT_LDOUBLE_SIZE __SIZEOF_LONG_DOUBLE__
544
+ #endif
545
+
546
+
547
+
548
+
549
+
550
+
551
+
552
+ #if __has_builtin(__builtin_huge_valf)
553
+ # define Z_COMPILER_CONSTANT_FLOAT_INFINITY __builtin_huge_valf()
554
+ #elif __has_builtin(__builtin_inff)
555
+ # define Z_COMPILER_CONSTANT_FLOAT_INFINITY __builtin_inff()
556
+ #endif
557
+
558
+ #if __has_builtin(__builtin_nanf)
559
+ # define Z_COMPILER_CONSTANT_FLOAT_NAN __builtin_nanf("")
560
+ #endif
561
+
562
+ #if __has_builtin(__builtin_huge_val)
563
+ # define Z_COMPILER_CONSTANT_DOUBLE_INFINITY __builtin_huge_val()
564
+ #elif __has_builtin(__builtin_inf)
565
+ # define Z_COMPILER_CONSTANT_DOUBLE_INFINITY __builtin_inf()
566
+ #endif
567
+
568
+ #if __has_builtin(__builtin_nan)
569
+ # define Z_COMPILER_CONSTANT_DOUBLE_NAN __builtin_nan("")
570
+ #endif
571
+
572
+ #if __has_builtin(__builtin_huge_vall)
573
+ # define Z_COMPILER_CONSTANT_LDOUBLE_INFINITY __builtin_huge_vall()
574
+ #elif __has_builtin(__builtin_infl)
575
+ # define Z_COMPILER_CONSTANT_LDOUBLE_INFINITY __builtin_infl()
576
+ #endif
577
+
578
+ #if __has_builtin(__builtin_nanl)
579
+ # define Z_COMPILER_CONSTANT_LDOUBLE_NAN __builtin_nanl("")
580
+ #endif
581
+
582
+ #if defined(__SIZEOF_SIZE_T__)
583
+ # define Z_COMPILER_CONSTANT_SIZE_BITS (__SIZEOF_SIZE_T__ * 8)
584
+ # define Z_COMPILER_CONSTANT_SIZE_SIZE __SIZEOF_SIZE_T__
585
+ # define Z_COMPILER_CONSTANT_SSIZE_BITS (__SIZEOF_SIZE_T__ * 8)
586
+ # define Z_COMPILER_CONSTANT_SSIZE_SIZE __SIZEOF_SIZE_T__
587
+ #elif defined(__SIZE_WIDTH__)
588
+ # define Z_COMPILER_CONSTANT_SIZE_BITS __SIZE_WIDTH__
589
+ # define Z_COMPILER_CONSTANT_SIZE_SIZE (__SIZE_WIDTH__ / 8)
590
+ # define Z_COMPILER_CONSTANT_SSIZE_BITS __SIZE_WIDTH__
591
+ # define Z_COMPILER_CONSTANT_SSIZE_SIZE (__SIZE_WIDTH__ / 8)
592
+ #endif
593
+
594
+ #if defined(__SIZEOF_POINTER__)
595
+ # define Z_COMPILER_CONSTANT_POINTER_BITS (__SIZEOF_POINTER__ * 8)
596
+ # define Z_COMPILER_CONSTANT_POINTER_SIZE __SIZEOF_POINTER__
597
+ #elif defined(__UINTPTR_WIDTH__)
598
+ # define Z_COMPILER_CONSTANT_POINTER_BITS __UINTPTR_WIDTH__
599
+ # define Z_COMPILER_CONSTANT_POINTER_SIZE (__UINTPTR_WIDTH__ / 8)
600
+ #elif defined(__INTPTR_WIDTH__)
601
+ # define Z_COMPILER_CONSTANT_POINTER_BITS __INTPTR_WIDTH__
602
+ # define Z_COMPILER_CONSTANT_POINTER_SIZE (__INTPTR_WIDTH__ / 8)
603
+ #endif
604
+
605
+ /* MARK: - Built-in types */
606
+
607
+ /*#define Z_COMPILER_TYPE_UINT8*/
608
+ /*#define Z_COMPILER_TYPE_UINT16*/
609
+ /*#define Z_COMPILER_TYPE_UINT32*/
610
+ /*#define Z_COMPILER_TYPE_UINT64*/
611
+
612
+ /*#define Z_COMPILER_TYPE_SINT8*/
613
+ /*#define Z_COMPILER_TYPE_SINT16*/
614
+ /*#define Z_COMPILER_TYPE_SINT32*/
615
+ /*#define Z_COMPILER_TYPE_SINT64*/
616
+
617
+ #ifdef __SIZEOF_INT128__
618
+ # define Z_COMPILER_TYPE_UINT128 __uint128_t
619
+ # define Z_COMPILER_TYPE_SINT128 __int128_t
620
+ #endif
621
+
622
+ /*#define Z_COMPILER_TYPE_FLOAT16*/
623
+ /*#define Z_COMPILER_TYPE_FLOAT24*/
624
+ /*#define Z_COMPILER_TYPE_FLOAT32*/
625
+ /*#define Z_COMPILER_TYPE_FLOAT48*/
626
+ /*#define Z_COMPILER_TYPE_FLOAT64*/
627
+ /*#define Z_COMPILER_TYPE_FLOAT72*/
628
+ /*#define Z_COMPILER_TYPE_FLOAT80*/
629
+ /*#define Z_COMPILER_TYPE_FLOAT96*/
630
+ /*#define Z_COMPILER_TYPE_FLOAT128*/
631
+
632
+ #define Z_COMPILER_TYPE_VAL __builtin_va_list
633
+
634
+ /* MARK: - Built-in literals */
635
+
636
+ /*#define Z_COMPILER_LITERAL_UINT8*/
637
+ /*#define Z_COMPILER_LITERAL_UINT16*/
638
+ /*#define Z_COMPILER_LITERAL_UINT32*/
639
+ /*#define Z_COMPILER_LITERAL_UINT64*/
640
+ /*#define Z_COMPILER_LITERAL_UINT128*/
641
+
642
+ /*#define Z_COMPILER_LITERAL_SINT8*/
643
+ /*#define Z_COMPILER_LITERAL_SINT16*/
644
+ /*#define Z_COMPILER_LITERAL_SINT32*/
645
+ /*#define Z_COMPILER_LITERAL_SINT64*/
646
+ /*#define Z_COMPILER_LITERAL_SINT128*/
647
+
648
+ /*#define Z_COMPILER_LITERAL_FLOAT16*/
649
+ /*#define Z_COMPILER_LITERAL_FLOAT24*/
650
+ /*#define Z_COMPILER_LITERAL_FLOAT32*/
651
+ /*#define Z_COMPILER_LITERAL_FLOAT48*/
652
+ /*#define Z_COMPILER_LITERAL_FLOAT64*/
653
+ /*#define Z_COMPILER_LITERAL_FLOAT72*/
654
+ /*#define Z_COMPILER_LITERAL_FLOAT80*/
655
+ /*#define Z_COMPILER_LITERAL_FLOAT96*/
656
+ /*#define Z_COMPILER_LITERAL_FLOAT128*/
657
+
658
+ /* MARK: - Built-in macros: Struture */
659
+
660
+ #define Z_COMPILER_MACRO_OFFSET_OF __builtin_offsetof
661
+
662
+ /* MARK: - Built-in macros: VAL
663
+ .-----------------------------------------------------------------.
664
+ | Please, read the comments for this section in the GCC's header. |
665
+ '----------------------------------------------------------------*/
666
+
667
+ #define Z_COMPILER_MACRO_VAL_INITIALIZE __builtin_va_start
668
+ #define Z_COMPILER_MACRO_VAL_FINALIZE __builtin_va_end
669
+ #define Z_COMPILER_MACRO_VAL_READ __builtin_va_arg
670
+
671
+ #if __has_builtin(__builtin_va_copy)
672
+ # define Z_COMPILER_MACRO_VAL_COPY(object, output) __builtin_va_copy(output, object)
673
+ #endif
674
+
675
+ /* MARK: - Built-in functions: Atomic operations */
676
+
677
+ #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
678
+
679
+ # if __has_builtin(__sync_bool_compare_and_swap)
680
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
681
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
682
+ # endif
683
+
684
+ /*#define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_SET*/
685
+ /*#define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_SET*/
686
+
687
+ # if __has_builtin(__sync_fetch_and_add)
688
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
689
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
690
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
691
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
692
+ # endif
693
+
694
+ # if __has_builtin(__sync_fetch_and_sub)
695
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
696
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
697
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
698
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
699
+ # endif
700
+
701
+ # if __has_builtin(__sync_fetch_and_and)
702
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_AND __sync_fetch_and_and
703
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_AND __sync_fetch_and_and
704
+ # endif
705
+
706
+ # if __has_builtin(__sync_fetch_and_or)
707
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_OR __sync_fetch_and_or
708
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_OR __sync_fetch_and_or
709
+ # endif
710
+
711
+ # if __has_builtin(__sync_fetch_and_xor)
712
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
713
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
714
+ # endif
715
+
716
+ # if __has_builtin(__sync_fetch_and_nand)
717
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
718
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
719
+ # endif
720
+
721
+ /*#define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_NOT*/
722
+ /*#define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_NOT*/
723
+
724
+ # if __has_builtin(__sync_add_and_fetch)
725
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
726
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
727
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
728
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
729
+ # endif
730
+
731
+ # if __has_builtin(__sync_sub_and_fetch)
732
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
733
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
734
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
735
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
736
+ # endif
737
+
738
+ # if __has_builtin(__sync_and_and_fetch)
739
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_AND_THEN_GET __sync_and_and_fetch
740
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_AND_THEN_GET __sync_and_and_fetch
741
+ # endif
742
+
743
+ # if __has_builtin(__sync_or_and_fetch)
744
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_OR_THEN_GET __sync_or_and_fetch
745
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_OR_THEN_GET __sync_or_and_fetch
746
+ # endif
747
+
748
+ # if __has_builtin(__sync_xor_and_fetch)
749
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
750
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
751
+ # endif
752
+
753
+ # if __has_builtin(__sync_nand_and_fetch)
754
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
755
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
756
+ # endif
757
+
758
+ /*#define Z_COMPILER_FUNCTION_UINT8_ATOMIC_NOT_THEN_GET*/
759
+ /*#define Z_COMPILER_FUNCTION_INT8_ATOMIC_NOT_THEN_GET*/
760
+
761
+ #endif
762
+
763
+ #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
764
+
765
+ # if __has_builtin(__sync_bool_compare_and_swap)
766
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
767
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
768
+ # endif
769
+
770
+ /*#define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_SET*/
771
+ /*#define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_SET*/
772
+
773
+ # if __has_builtin(__sync_fetch_and_add)
774
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
775
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
776
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
777
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
778
+ # endif
779
+
780
+ # if __has_builtin(__sync_fetch_and_sub)
781
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
782
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
783
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
784
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
785
+ # endif
786
+
787
+ # if __has_builtin(__sync_fetch_and_and)
788
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_AND __sync_fetch_and_and
789
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_AND __sync_fetch_and_and
790
+ # endif
791
+
792
+ # if __has_builtin(__sync_fetch_and_or)
793
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_OR __sync_fetch_and_or
794
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_OR __sync_fetch_and_or
795
+ # endif
796
+
797
+ # if __has_builtin(__sync_fetch_and_xor)
798
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
799
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
800
+ # endif
801
+
802
+ # if __has_builtin(__sync_fetch_and_nand)
803
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
804
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
805
+ # endif
806
+
807
+ /*#define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_NOT*/
808
+ /*#define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_NOT*/
809
+
810
+ # if __has_builtin(__sync_add_and_fetch)
811
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
812
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
813
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
814
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
815
+ # endif
816
+
817
+ # if __has_builtin(__sync_sub_and_fetch)
818
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
819
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
820
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
821
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
822
+ # endif
823
+
824
+ # if __has_builtin(__sync_and_and_fetch)
825
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_AND_THEN_GET __sync_and_and_fetch
826
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_AND_THEN_GET __sync_and_and_fetch
827
+ # endif
828
+
829
+ # if __has_builtin(__sync_or_and_fetch)
830
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_OR_THEN_GET __sync_or_and_fetch
831
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_OR_THEN_GET __sync_or_and_fetch
832
+ # endif
833
+
834
+ # if __has_builtin(__sync_xor_and_fetch)
835
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
836
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
837
+ # endif
838
+
839
+ # if __has_builtin(__sync_nand_and_fetch)
840
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
841
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
842
+ # endif
843
+
844
+ /*#define Z_COMPILER_FUNCTION_UINT16_ATOMIC_NOT_THEN_GET*/
845
+ /*#define Z_COMPILER_FUNCTION_INT16_ATOMIC_NOT_THEN_GET*/
846
+
847
+ #endif
848
+
849
+ #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
850
+
851
+ # if __has_builtin(__sync_bool_compare_and_swap)
852
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
853
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
854
+ # endif
855
+
856
+ /*#define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_SET*/
857
+ /*#define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_SET*/
858
+
859
+ # if __has_builtin(__sync_fetch_and_add)
860
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
861
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
862
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
863
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
864
+ # endif
865
+
866
+ # if __has_builtin(__sync_fetch_and_sub)
867
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
868
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
869
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
870
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
871
+ # endif
872
+
873
+ # if __has_builtin(__sync_fetch_and_and)
874
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_AND __sync_fetch_and_and
875
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_AND __sync_fetch_and_and
876
+ # endif
877
+
878
+ # if __has_builtin(__sync_fetch_and_or)
879
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_OR __sync_fetch_and_or
880
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_OR __sync_fetch_and_or
881
+ # endif
882
+
883
+ # if __has_builtin(__sync_fetch_and_xor)
884
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
885
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
886
+ # endif
887
+
888
+ # if __has_builtin(__sync_fetch_and_nand)
889
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
890
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
891
+ # endif
892
+
893
+ /*#define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_NOT*/
894
+ /*#define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_NOT*/
895
+
896
+ # if __has_builtin(__sync_add_and_fetch)
897
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
898
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
899
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
900
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
901
+ # endif
902
+
903
+ # if __has_builtin(__sync_sub_and_fetch)
904
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
905
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
906
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
907
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
908
+ # endif
909
+
910
+ # if __has_builtin(__sync_and_and_fetch)
911
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_AND_THEN_GET __sync_and_and_fetch
912
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_AND_THEN_GET __sync_and_and_fetch
913
+ # endif
914
+
915
+ # if __has_builtin(__sync_or_and_fetch)
916
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_OR_THEN_GET __sync_or_and_fetch
917
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_OR_THEN_GET __sync_or_and_fetch
918
+ # endif
919
+
920
+ # if __has_builtin(__sync_xor_and_fetch)
921
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
922
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
923
+ # endif
924
+
925
+ # if __has_builtin(__sync_nand_and_fetch)
926
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
927
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
928
+ # endif
929
+
930
+ /*#define Z_COMPILER_FUNCTION_UINT32_ATOMIC_NOT_THEN_GET*/
931
+ /*#define Z_COMPILER_FUNCTION_INT32_ATOMIC_NOT_THEN_GET*/
932
+
933
+ #endif
934
+
935
+ #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
936
+
937
+ # if __has_builtin(__sync_bool_compare_and_swap)
938
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
939
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
940
+ # endif
941
+
942
+ /*#define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_SET*/
943
+ /*#define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_SET*/
944
+
945
+ # if __has_builtin(__sync_fetch_and_add)
946
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
947
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
948
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
949
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
950
+ # endif
951
+
952
+ # if __has_builtin(__sync_fetch_and_sub)
953
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
954
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
955
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
956
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
957
+ # endif
958
+
959
+ # if __has_builtin(__sync_fetch_and_and)
960
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_AND __sync_fetch_and_and
961
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_AND __sync_fetch_and_and
962
+ # endif
963
+
964
+ # if __has_builtin(__sync_fetch_and_or)
965
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_OR __sync_fetch_and_or
966
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_OR __sync_fetch_and_or
967
+ # endif
968
+
969
+ # if __has_builtin(__sync_fetch_and_xor)
970
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
971
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
972
+ # endif
973
+
974
+ # if __has_builtin(__sync_fetch_and_nand)
975
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
976
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
977
+ # endif
978
+
979
+ /*#define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_NOT*/
980
+ /*#define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_NOT*/
981
+
982
+ # if __has_builtin(__sync_add_and_fetch)
983
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
984
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
985
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
986
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
987
+ # endif
988
+
989
+ # if __has_builtin(__sync_sub_and_fetch)
990
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
991
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
992
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
993
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
994
+ # endif
995
+
996
+ # if __has_builtin(__sync_and_and_fetch)
997
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_AND_THEN_GET __sync_and_and_fetch
998
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_AND_THEN_GET __sync_and_and_fetch
999
+ # endif
1000
+
1001
+ # if __has_builtin(__sync_or_and_fetch)
1002
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1003
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1004
+ # endif
1005
+
1006
+ # if __has_builtin(__sync_xor_and_fetch)
1007
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1008
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1009
+ # endif
1010
+
1011
+ # if __has_builtin(__sync_nand_and_fetch)
1012
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
1013
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
1014
+ # endif
1015
+
1016
+ /*#define Z_COMPILER_FUNCTION_UINT64_ATOMIC_NOT_THEN_GET*/
1017
+ /*#define Z_COMPILER_FUNCTION_INT64_ATOMIC_NOT_THEN_GET*/
1018
+
1019
+ #endif
1020
+
1021
+ #if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
1022
+
1023
+ # if __has_builtin(__sync_bool_compare_and_swap)
1024
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1025
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1026
+ # endif
1027
+
1028
+ /*#define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_SET*/
1029
+ /*#define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_SET*/
1030
+
1031
+ # if __has_builtin(__sync_fetch_and_add)
1032
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
1033
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1034
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1035
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1036
+ # endif
1037
+
1038
+ # if __has_builtin(__sync_fetch_and_sub)
1039
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
1040
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1041
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1042
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1043
+ # endif
1044
+
1045
+ # if __has_builtin(__sync_fetch_and_and)
1046
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1047
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1048
+ # endif
1049
+
1050
+ # if __has_builtin(__sync_fetch_and_or)
1051
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1052
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1053
+ # endif
1054
+
1055
+ # if __has_builtin(__sync_fetch_and_xor)
1056
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1057
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1058
+ # endif
1059
+
1060
+ # if __has_builtin(__sync_fetch_and_nand)
1061
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
1062
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_NAND __sync_fetch_and_nand
1063
+ # endif
1064
+
1065
+ /*#define Z_COMPILER_FUNCTION_UINT128_ATOMIC_GET_THEN_NOT*/
1066
+ /*#define Z_COMPILER_FUNCTION_INT128_ATOMIC_GET_THEN_NOT*/
1067
+
1068
+ # if __has_builtin(__sync_add_and_fetch)
1069
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
1070
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1071
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1072
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1073
+ # endif
1074
+
1075
+ # if __has_builtin(__sync_sub_and_fetch)
1076
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
1077
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1078
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1079
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1080
+ # endif
1081
+
1082
+ # if __has_builtin(__sync_and_and_fetch)
1083
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1084
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1085
+ # endif
1086
+
1087
+ # if __has_builtin(__sync_or_and_fetch)
1088
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1089
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1090
+ # endif
1091
+
1092
+ # if __has_builtin(__sync_xor_and_fetch)
1093
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1094
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1095
+ # endif
1096
+
1097
+ # if __has_builtin(__sync_nand_and_fetch)
1098
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
1099
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_NAND_THEN_GET __sync_nand_and_fetch
1100
+ # endif
1101
+
1102
+ /*#define Z_COMPILER_FUNCTION_UINT128_ATOMIC_NOT_THEN_GET*/
1103
+ /*#define Z_COMPILER_FUNCTION_INT128_ATOMIC_NOT_THEN_GET*/
1104
+
1105
+ #endif
1106
+
1107
+ #endif /* _Z_inspection_modules_compiler_Clang_H_ */
1108
+
1109
+
1110
+
1111
+
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+
1172
+
1173
+ /* MARK: - Built-in types */
1174
+
1175
+ #ifdef __SIZEOF_INT128__
1176
+ # define Z_COMPILER_TYPE_UINT128 __uint128_t
1177
+ # define Z_COMPILER_TYPE_INT128 __int128_t
1178
+ #endif
1179
+
1180
+ #define Z_COMPILER_TYPE_VAL __builtin_va_list
1181
+
1182
+ /* MARK: - Built-in macros: Struture */
1183
+
1184
+ #define Z_COMPILER_MACRO_OFFSET_OF __builtin_offsetof
1185
+
1186
+ /* MARK: - Built-in macros: VAL
1187
+ .------------------------------------------------------------------------------.
1188
+ | GCC has a BIG __BUG__ which breaks the CDECL calling convention on x86-32. |
1189
+ | This makes necessary to always use the GCC's internal built-in macros for |
1190
+ | dealing with variable argument lists. |
1191
+ | |
1192
+ | Read the complete story: |
1193
+ | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45249 |
1194
+ | |
1195
+ | This should not be a problem, after all the built-in macros work well, but |
1196
+ | some versions of GCC create dependencies with the C standard library under |
1197
+ | certain conditions if they are used. The way to fix this is to use the |
1198
+ | "-fno-builtin" option to make GCC, paradoxically, generate true built-ins. |
1199
+ '-----------------------------------------------------------------------------*/
1200
+
1201
+ #define Z_COMPILER_MACRO_VAL_INITIALIZE __builtin_va_start
1202
+ #define Z_COMPILER_MACRO_VAL_FINALIZE __builtin_va_end
1203
+ #define Z_COMPILER_MACRO_VAL_READ __builtin_va_arg
1204
+
1205
+ #if __STDC_VERSION__ >= 199900L || !defined(__STRICT_ANSI__)
1206
+ # define Z_COMPILER_MACRO_VAL_COPY(object, output) __builtin_va_copy(output, object)
1207
+ #endif
1208
+
1209
+ /* MARK: - Built-in functions: Atomic operations */
1210
+
1211
+ #if Z_COMPILER_VERSION >= Z_VERSION(4, 1, 0)
1212
+
1213
+ # ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
1214
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1215
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1216
+ # endif
1217
+
1218
+ # ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2
1219
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1220
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1221
+ # endif
1222
+
1223
+ # ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
1224
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1225
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1226
+ # endif
1227
+
1228
+ # ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
1229
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1230
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1231
+ # endif
1232
+
1233
+ # ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16
1234
+ # define Z_COMPILER_FUNCTION_UINT128_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1235
+ # define Z_COMPILER_FUNCTION_INT128_ATOMIC_SET_IF_EQUAL __sync_bool_compare_and_swap
1236
+ # endif
1237
+
1238
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1239
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
1240
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
1241
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_INCREMENT(pointer) __sync_fetch_and_add(pointer, 1)
1242
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1243
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1244
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1245
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_INCREMENT( pointer) __sync_fetch_and_add(pointer, 1)
1246
+
1247
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1248
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1249
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1250
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1251
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1252
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1253
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1254
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_ADD __sync_fetch_and_add
1255
+
1256
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1257
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
1258
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
1259
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_DECREMENT(pointer) __sync_fetch_and_sub(pointer, 1)
1260
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1261
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1262
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1263
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_DECREMENT( pointer) __sync_fetch_and_sub(pointer, 1)
1264
+
1265
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1266
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1267
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1268
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1269
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1270
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1271
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1272
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_SUBTRACT __sync_fetch_and_sub
1273
+
1274
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1275
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1276
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1277
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1278
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1279
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1280
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1281
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_AND __sync_fetch_and_and
1282
+
1283
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1284
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1285
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1286
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1287
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1288
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1289
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1290
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_OR __sync_fetch_and_or
1291
+
1292
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1293
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1294
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1295
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1296
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1297
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1298
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1299
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_GET_THEN_XOR __sync_fetch_and_xor
1300
+
1301
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1302
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
1303
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
1304
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_INCREMENT_THEN_GET(pointer) __sync_add_and_fetch(pointer, 1)
1305
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1306
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1307
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1308
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_INCREMENT_THEN_GET( pointer) __sync_add_and_fetch(pointer, 1)
1309
+
1310
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1311
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1312
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1313
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1314
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1315
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1316
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1317
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_ADD_THEN_GET __sync_add_and_fetch
1318
+
1319
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1320
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
1321
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
1322
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_DECREMENT_THEN_GET(pointer) __sync_sub_and_fetch(pointer, 1)
1323
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1324
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1325
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1326
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_DECREMENT_THEN_GET( pointer) __sync_sub_and_fetch(pointer, 1)
1327
+
1328
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1329
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1330
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1331
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1332
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1333
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1334
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1335
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_SUBTRACT_THEN_GET __sync_sub_and_fetch
1336
+
1337
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1338
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1339
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1340
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1341
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1342
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1343
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1344
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_AND_THEN_GET __sync_and_and_fetch
1345
+
1346
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1347
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1348
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1349
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1350
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1351
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1352
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1353
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_OR_THEN_GET __sync_or_and_fetch
1354
+
1355
+ # define Z_COMPILER_FUNCTION_UINT8_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1356
+ # define Z_COMPILER_FUNCTION_UINT16_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1357
+ # define Z_COMPILER_FUNCTION_UINT32_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1358
+ # define Z_COMPILER_FUNCTION_UINT64_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1359
+ # define Z_COMPILER_FUNCTION_INT8_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1360
+ # define Z_COMPILER_FUNCTION_INT16_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1361
+ # define Z_COMPILER_FUNCTION_INT32_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1362
+ # define Z_COMPILER_FUNCTION_INT64_ATOMIC_XOR_THEN_GET __sync_xor_and_fetch
1363
+
1364
+ #endif
1365
+
1366
+ #endif /* _Z_inspection_modules_compiler_GCC_H_ */