simpleble 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (341) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +88 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +350 -0
  5. data/ext/simpleble/extconf.rb +57 -0
  6. data/ext/simpleble/simpleble_ruby.c +682 -0
  7. data/lib/simpleble/adapter.rb +10 -0
  8. data/lib/simpleble/characteristic.rb +36 -0
  9. data/lib/simpleble/descriptor.rb +8 -0
  10. data/lib/simpleble/exceptions.rb +25 -0
  11. data/lib/simpleble/peripheral.rb +64 -0
  12. data/lib/simpleble/service.rb +16 -0
  13. data/lib/simpleble/version.rb +3 -0
  14. data/lib/simpleble.rb +40 -0
  15. data/vendor/simpleble/build_simplecble/CMakeFiles/4.0.3/CompilerIdCXX/CMakeCXXCompilerId.cpp +920 -0
  16. data/vendor/simpleble/build_simplecble/CMakeFiles/4.0.3/CompilerIdCXX/apple-sdk.cpp +1 -0
  17. data/vendor/simpleble/build_simplecble/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp +949 -0
  18. data/vendor/simpleble/build_simplecble/CMakeFiles/4.1.0/CompilerIdCXX/apple-sdk.cpp +1 -0
  19. data/vendor/simpleble/build_simplecble/export/simplecble/export.h +43 -0
  20. data/vendor/simpleble/build_simplecble/simpleble/export/simpleble/export.h +43 -0
  21. data/vendor/simpleble/dependencies/external/kvn/kvn_bytearray.h +222 -0
  22. data/vendor/simpleble/dependencies/external/kvn/kvn_safe_callback.hpp +66 -0
  23. data/vendor/simpleble/dependencies/external/kvn/logfwd.hpp +35 -0
  24. data/vendor/simpleble/dependencies/internal/fmt/args.h +220 -0
  25. data/vendor/simpleble/dependencies/internal/fmt/base.h +2962 -0
  26. data/vendor/simpleble/dependencies/internal/fmt/chrono.h +2338 -0
  27. data/vendor/simpleble/dependencies/internal/fmt/color.h +610 -0
  28. data/vendor/simpleble/dependencies/internal/fmt/compile.h +539 -0
  29. data/vendor/simpleble/dependencies/internal/fmt/core.h +5 -0
  30. data/vendor/simpleble/dependencies/internal/fmt/format-inl.h +1949 -0
  31. data/vendor/simpleble/dependencies/internal/fmt/format.h +4244 -0
  32. data/vendor/simpleble/dependencies/internal/fmt/os.h +427 -0
  33. data/vendor/simpleble/dependencies/internal/fmt/ostream.h +166 -0
  34. data/vendor/simpleble/dependencies/internal/fmt/printf.h +633 -0
  35. data/vendor/simpleble/dependencies/internal/fmt/ranges.h +850 -0
  36. data/vendor/simpleble/dependencies/internal/fmt/std.h +726 -0
  37. data/vendor/simpleble/dependencies/internal/fmt/xchar.h +373 -0
  38. data/vendor/simpleble/dependencies/internal/simplejni/Common.hpp +579 -0
  39. data/vendor/simpleble/dependencies/internal/simplejni/References.hpp +151 -0
  40. data/vendor/simpleble/dependencies/internal/simplejni/Registry.hpp +183 -0
  41. data/vendor/simpleble/dependencies/internal/simplejni/VM.hpp +88 -0
  42. data/vendor/simpleble/examples/simpleble/src/connect.cpp +67 -0
  43. data/vendor/simpleble/examples/simpleble/src/connect_safe.cpp +91 -0
  44. data/vendor/simpleble/examples/simpleble/src/list_adapters.cpp +22 -0
  45. data/vendor/simpleble/examples/simpleble/src/list_adapters_safe.cpp +33 -0
  46. data/vendor/simpleble/examples/simpleble/src/list_paired.cpp +27 -0
  47. data/vendor/simpleble/examples/simpleble/src/multiconnect.cpp +60 -0
  48. data/vendor/simpleble/examples/simpleble/src/notify.cpp +85 -0
  49. data/vendor/simpleble/examples/simpleble/src/notify_multi.cpp +101 -0
  50. data/vendor/simpleble/examples/simpleble/src/power_cycle.cpp +43 -0
  51. data/vendor/simpleble/examples/simpleble/src/read.cpp +82 -0
  52. data/vendor/simpleble/examples/simpleble/src/scan.cpp +62 -0
  53. data/vendor/simpleble/examples/simpleble/src/utils.cpp +59 -0
  54. data/vendor/simpleble/examples/simpleble/src/utils.hpp +27 -0
  55. data/vendor/simpleble/examples/simpleble/src/write.cpp +81 -0
  56. data/vendor/simpleble/examples/simplebluez/ble_nus/ble_nus.cpp +138 -0
  57. data/vendor/simpleble/examples/simplebluez/connect/connect.cpp +119 -0
  58. data/vendor/simpleble/examples/simplebluez/list_adapters/list_adapters.cpp +44 -0
  59. data/vendor/simpleble/examples/simplebluez/list_paired/list_paired.cpp +48 -0
  60. data/vendor/simpleble/examples/simplebluez/notify/notify.cpp +145 -0
  61. data/vendor/simpleble/examples/simplebluez/pair/pair.cpp +181 -0
  62. data/vendor/simpleble/examples/simplebluez/read/read.cpp +141 -0
  63. data/vendor/simpleble/examples/simplebluez/scan/scan.cpp +85 -0
  64. data/vendor/simpleble/examples/simplecble/c/connect.c +163 -0
  65. data/vendor/simpleble/examples/simplecble/c/notify.c +217 -0
  66. data/vendor/simpleble/examples/simplecble/c/scan.c +164 -0
  67. data/vendor/simpleble/examples/simpledbus/notification.cpp +24 -0
  68. data/vendor/simpleble/hitl/src/test_sanity.cpp +48 -0
  69. data/vendor/simpleble/install_simplecble/include/simpleble/Adapter.h +102 -0
  70. data/vendor/simpleble/install_simplecble/include/simpleble/AdapterSafe.h +58 -0
  71. data/vendor/simpleble/install_simplecble/include/simpleble/Advanced.h +50 -0
  72. data/vendor/simpleble/install_simplecble/include/simpleble/Characteristic.h +39 -0
  73. data/vendor/simpleble/install_simplecble/include/simpleble/Config.h +55 -0
  74. data/vendor/simpleble/install_simplecble/include/simpleble/Descriptor.h +30 -0
  75. data/vendor/simpleble/install_simplecble/include/simpleble/Exceptions.h +72 -0
  76. data/vendor/simpleble/install_simplecble/include/simpleble/Logging.h +73 -0
  77. data/vendor/simpleble/install_simplecble/include/simpleble/Peripheral.h +82 -0
  78. data/vendor/simpleble/install_simplecble/include/simpleble/PeripheralSafe.h +64 -0
  79. data/vendor/simpleble/install_simplecble/include/simpleble/Service.h +34 -0
  80. data/vendor/simpleble/install_simplecble/include/simpleble/SimpleBLE.h +8 -0
  81. data/vendor/simpleble/install_simplecble/include/simpleble/Types.h +49 -0
  82. data/vendor/simpleble/install_simplecble/include/simpleble/Utils.h +13 -0
  83. data/vendor/simpleble/install_simplecble/include/simpleble/export.h +43 -0
  84. data/vendor/simpleble/install_simplecble/include/simpleble/kvn/kvn_bytearray.h +222 -0
  85. data/vendor/simpleble/install_simplecble/include/simplecble/adapter.h +188 -0
  86. data/vendor/simpleble/install_simplecble/include/simplecble/logging.h +37 -0
  87. data/vendor/simpleble/install_simplecble/include/simplecble/peripheral.h +304 -0
  88. data/vendor/simpleble/install_simplecble/include/simplecble/simpleble.h +21 -0
  89. data/vendor/simpleble/install_simplecble/include/simplecble/types.h +73 -0
  90. data/vendor/simpleble/install_simplecble/include/simplecble/utils.h +27 -0
  91. data/vendor/simpleble/simpleble/include/simpleble/Adapter.h +102 -0
  92. data/vendor/simpleble/simpleble/include/simpleble/AdapterSafe.h +58 -0
  93. data/vendor/simpleble/simpleble/include/simpleble/Characteristic.h +39 -0
  94. data/vendor/simpleble/simpleble/include/simpleble/Config.h +55 -0
  95. data/vendor/simpleble/simpleble/include/simpleble/Descriptor.h +30 -0
  96. data/vendor/simpleble/simpleble/include/simpleble/Exceptions.h +72 -0
  97. data/vendor/simpleble/simpleble/include/simpleble/Logging.h +73 -0
  98. data/vendor/simpleble/simpleble/include/simpleble/Peripheral.h +82 -0
  99. data/vendor/simpleble/simpleble/include/simpleble/PeripheralSafe.h +64 -0
  100. data/vendor/simpleble/simpleble/include/simpleble/Service.h +34 -0
  101. data/vendor/simpleble/simpleble/include/simpleble/SimpleBLE.h +8 -0
  102. data/vendor/simpleble/simpleble/include/simpleble/Types.h +49 -0
  103. data/vendor/simpleble/simpleble/include/simpleble/Utils.h +13 -0
  104. data/vendor/simpleble/simpleble/include/simpleble_c/adapter.h +188 -0
  105. data/vendor/simpleble/simpleble/include/simpleble_c/logging.h +37 -0
  106. data/vendor/simpleble/simpleble/include/simpleble_c/peripheral.h +304 -0
  107. data/vendor/simpleble/simpleble/include/simpleble_c/simpleble.h +21 -0
  108. data/vendor/simpleble/simpleble/include/simpleble_c/types.h +73 -0
  109. data/vendor/simpleble/simpleble/include/simpleble_c/utils.h +27 -0
  110. data/vendor/simpleble/simpleble/src/CommonUtils.h +63 -0
  111. data/vendor/simpleble/simpleble/src/Exceptions.cpp +31 -0
  112. data/vendor/simpleble/simpleble/src/Logging.cpp +136 -0
  113. data/vendor/simpleble/simpleble/src/LoggingInternal.h +85 -0
  114. data/vendor/simpleble/simpleble/src/Utils.cpp +24 -0
  115. data/vendor/simpleble/simpleble/src/backends/android/AdapterAndroid.cpp +101 -0
  116. data/vendor/simpleble/simpleble/src/backends/android/AdapterAndroid.h +70 -0
  117. data/vendor/simpleble/simpleble/src/backends/android/BackendAndroid.cpp +40 -0
  118. data/vendor/simpleble/simpleble/src/backends/android/BackendAndroid.h +20 -0
  119. data/vendor/simpleble/simpleble/src/backends/android/PeripheralAndroid.cpp +365 -0
  120. data/vendor/simpleble/simpleble/src/backends/android/PeripheralAndroid.h +90 -0
  121. data/vendor/simpleble/simpleble/src/backends/android/bridge/BluetoothGattCallback.cpp +432 -0
  122. data/vendor/simpleble/simpleble/src/backends/android/bridge/BluetoothGattCallback.h +102 -0
  123. data/vendor/simpleble/simpleble/src/backends/android/bridge/ScanCallback.cpp +142 -0
  124. data/vendor/simpleble/simpleble/src/backends/android/bridge/ScanCallback.h +55 -0
  125. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.cpp +107 -0
  126. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothAdapter.h +55 -0
  127. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.cpp +68 -0
  128. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothDevice.h +54 -0
  129. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.cpp +115 -0
  130. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGatt.h +75 -0
  131. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.cpp +142 -0
  132. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattCharacteristic.h +66 -0
  133. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.cpp +67 -0
  134. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattDescriptor.h +46 -0
  135. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.cpp +106 -0
  136. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/BluetoothGattService.h +47 -0
  137. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.cpp +47 -0
  138. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/BluetoothScanner.h +37 -0
  139. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.cpp +69 -0
  140. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanRecord.h +41 -0
  141. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.cpp +63 -0
  142. data/vendor/simpleble/simpleble/src/backends/android/types/android/bluetooth/le/ScanResult.h +42 -0
  143. data/vendor/simpleble/simpleble/src/backends/android/types/android/os/ParcelUUID.cpp +32 -0
  144. data/vendor/simpleble/simpleble/src/backends/android/types/android/os/ParcelUUID.h +30 -0
  145. data/vendor/simpleble/simpleble/src/backends/android/types/android/util/SparseArray.cpp +54 -0
  146. data/vendor/simpleble/simpleble/src/backends/android/types/android/util/SparseArray.h +37 -0
  147. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Iterator.cpp +36 -0
  148. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Iterator.h +28 -0
  149. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/List.cpp +29 -0
  150. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/List.h +27 -0
  151. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Set.cpp +33 -0
  152. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/Set.h +28 -0
  153. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/UUID.cpp +26 -0
  154. data/vendor/simpleble/simpleble/src/backends/android/types/java/util/UUID.h +29 -0
  155. data/vendor/simpleble/simpleble/src/backends/common/AdapterBase.cpp +53 -0
  156. data/vendor/simpleble/simpleble/src/backends/common/AdapterBase.h +81 -0
  157. data/vendor/simpleble/simpleble/src/backends/common/AdapterBaseTypes.h +22 -0
  158. data/vendor/simpleble/simpleble/src/backends/common/BackendBase.h +20 -0
  159. data/vendor/simpleble/simpleble/src/backends/common/BackendUtils.h +33 -0
  160. data/vendor/simpleble/simpleble/src/backends/common/CharacteristicBase.cpp +28 -0
  161. data/vendor/simpleble/simpleble/src/backends/common/CharacteristicBase.h +38 -0
  162. data/vendor/simpleble/simpleble/src/backends/common/DescriptorBase.cpp +7 -0
  163. data/vendor/simpleble/simpleble/src/backends/common/DescriptorBase.h +19 -0
  164. data/vendor/simpleble/simpleble/src/backends/common/PeripheralBase.h +82 -0
  165. data/vendor/simpleble/simpleble/src/backends/common/ServiceBase.cpp +18 -0
  166. data/vendor/simpleble/simpleble/src/backends/common/ServiceBase.h +28 -0
  167. data/vendor/simpleble/simpleble/src/backends/linux/AdapterLinux.cpp +102 -0
  168. data/vendor/simpleble/simpleble/src/backends/linux/AdapterLinux.h +55 -0
  169. data/vendor/simpleble/simpleble/src/backends/linux/BackendBluez.cpp +87 -0
  170. data/vendor/simpleble/simpleble/src/backends/linux/PeripheralLinux.cpp +376 -0
  171. data/vendor/simpleble/simpleble/src/backends/linux/PeripheralLinux.h +90 -0
  172. data/vendor/simpleble/simpleble/src/backends/macos/AdapterBaseMacOS.h +29 -0
  173. data/vendor/simpleble/simpleble/src/backends/macos/AdapterMac.h +78 -0
  174. data/vendor/simpleble/simpleble/src/backends/macos/PeripheralBaseMacOS.h +49 -0
  175. data/vendor/simpleble/simpleble/src/backends/macos/PeripheralMac.h +81 -0
  176. data/vendor/simpleble/simpleble/src/backends/macos/Utils.h +9 -0
  177. data/vendor/simpleble/simpleble/src/backends/plain/AdapterPlain.cpp +65 -0
  178. data/vendor/simpleble/simpleble/src/backends/plain/AdapterPlain.h +49 -0
  179. data/vendor/simpleble/simpleble/src/backends/plain/BackendPlain.cpp +30 -0
  180. data/vendor/simpleble/simpleble/src/backends/plain/PeripheralPlain.cpp +159 -0
  181. data/vendor/simpleble/simpleble/src/backends/plain/PeripheralPlain.h +72 -0
  182. data/vendor/simpleble/simpleble/src/backends/windows/AdapterWindows.cpp +330 -0
  183. data/vendor/simpleble/simpleble/src/backends/windows/AdapterWindows.h +89 -0
  184. data/vendor/simpleble/simpleble/src/backends/windows/BackendWinRT.cpp +67 -0
  185. data/vendor/simpleble/simpleble/src/backends/windows/BackendWinRT.h +18 -0
  186. data/vendor/simpleble/simpleble/src/backends/windows/MtaManager.cpp +49 -0
  187. data/vendor/simpleble/simpleble/src/backends/windows/MtaManager.h +90 -0
  188. data/vendor/simpleble/simpleble/src/backends/windows/PeripheralWindows.cpp +487 -0
  189. data/vendor/simpleble/simpleble/src/backends/windows/PeripheralWindows.h +129 -0
  190. data/vendor/simpleble/simpleble/src/backends/windows/Utils.cpp +146 -0
  191. data/vendor/simpleble/simpleble/src/backends/windows/Utils.h +47 -0
  192. data/vendor/simpleble/simpleble/src/builders/BuildVec.h +32 -0
  193. data/vendor/simpleble/simpleble/src/builders/BuilderBase.h +87 -0
  194. data/vendor/simpleble/simpleble/src/external/TaskRunner.hpp +99 -0
  195. data/vendor/simpleble/simpleble/src/external/ThreadRunner.h +52 -0
  196. data/vendor/simpleble/simpleble/src/external/kvn_safe_callback.hpp +66 -0
  197. data/vendor/simpleble/simpleble/src/external/kvn_safe_map.hpp +94 -0
  198. data/vendor/simpleble/simpleble/src/external/kvn_threadrunner.hpp +70 -0
  199. data/vendor/simpleble/simpleble/src/external/logfwd.hpp +35 -0
  200. data/vendor/simpleble/simpleble/src/frontends/base/Adapter.cpp +111 -0
  201. data/vendor/simpleble/simpleble/src/frontends/base/Backend.cpp +83 -0
  202. data/vendor/simpleble/simpleble/src/frontends/base/Backend.h +76 -0
  203. data/vendor/simpleble/simpleble/src/frontends/base/Characteristic.cpp +56 -0
  204. data/vendor/simpleble/simpleble/src/frontends/base/Descriptor.cpp +21 -0
  205. data/vendor/simpleble/simpleble/src/frontends/base/Peripheral.cpp +113 -0
  206. data/vendor/simpleble/simpleble/src/frontends/base/Service.cpp +26 -0
  207. data/vendor/simpleble/simpleble/src/frontends/safe/AdapterSafe.cpp +158 -0
  208. data/vendor/simpleble/simpleble/src/frontends/safe/PeripheralSafe.cpp +219 -0
  209. data/vendor/simpleble/simpleble/src_c/adapter.cpp +204 -0
  210. data/vendor/simpleble/simpleble/src_c/logging.cpp +19 -0
  211. data/vendor/simpleble/simpleble/src_c/peripheral.cpp +444 -0
  212. data/vendor/simpleble/simpleble/src_c/simpleble.cpp +5 -0
  213. data/vendor/simpleble/simpleble/src_c/utils.cpp +15 -0
  214. data/vendor/simpleble/simpleble/test/src/main.cpp +8 -0
  215. data/vendor/simpleble/simpleble/test/src/test_bytearray.cpp +246 -0
  216. data/vendor/simpleble/simpleble/test/src/test_utils.cpp +24 -0
  217. data/vendor/simpleble/simplebluez/include/simplebluez/Adapter.h +46 -0
  218. data/vendor/simpleble/simplebluez/include/simplebluez/Agent.h +52 -0
  219. data/vendor/simpleble/simplebluez/include/simplebluez/Bluez.h +37 -0
  220. data/vendor/simpleble/simplebluez/include/simplebluez/BluezOrg.h +22 -0
  221. data/vendor/simpleble/simplebluez/include/simplebluez/BluezOrgBluez.h +26 -0
  222. data/vendor/simpleble/simplebluez/include/simplebluez/BluezRoot.h +32 -0
  223. data/vendor/simpleble/simplebluez/include/simplebluez/Characteristic.h +46 -0
  224. data/vendor/simpleble/simplebluez/include/simplebluez/Descriptor.h +33 -0
  225. data/vendor/simpleble/simplebluez/include/simplebluez/Device.h +64 -0
  226. data/vendor/simpleble/simplebluez/include/simplebluez/Exceptions.h +43 -0
  227. data/vendor/simpleble/simplebluez/include/simplebluez/Service.h +27 -0
  228. data/vendor/simpleble/simplebluez/include/simplebluez/Types.h +9 -0
  229. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Adapter1.h +49 -0
  230. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Agent1.h +100 -0
  231. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/AgentManager1.h +24 -0
  232. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Battery1.h +32 -0
  233. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/Device1.h +62 -0
  234. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattCharacteristic1.h +48 -0
  235. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattDescriptor1.h +41 -0
  236. data/vendor/simpleble/simplebluez/include/simplebluez/interfaces/GattService1.h +28 -0
  237. data/vendor/simpleble/simplebluez/src/Adapter.cpp +78 -0
  238. data/vendor/simpleble/simplebluez/src/Agent.cpp +72 -0
  239. data/vendor/simpleble/simplebluez/src/Bluez.cpp +45 -0
  240. data/vendor/simpleble/simplebluez/src/BluezOrg.cpp +20 -0
  241. data/vendor/simpleble/simplebluez/src/BluezOrgBluez.cpp +23 -0
  242. data/vendor/simpleble/simplebluez/src/BluezRoot.cpp +44 -0
  243. data/vendor/simpleble/simplebluez/src/Characteristic.cpp +64 -0
  244. data/vendor/simpleble/simplebluez/src/Descriptor.cpp +27 -0
  245. data/vendor/simpleble/simplebluez/src/Device.cpp +104 -0
  246. data/vendor/simpleble/simplebluez/src/Exceptions.cpp +29 -0
  247. data/vendor/simpleble/simplebluez/src/Logging.cpp +52 -0
  248. data/vendor/simpleble/simplebluez/src/Logging.h +57 -0
  249. data/vendor/simpleble/simplebluez/src/Service.cpp +33 -0
  250. data/vendor/simpleble/simplebluez/src/interfaces/Adapter1.cpp +123 -0
  251. data/vendor/simpleble/simplebluez/src/interfaces/Agent1.cpp +143 -0
  252. data/vendor/simpleble/simplebluez/src/interfaces/AgentManager1.cpp +34 -0
  253. data/vendor/simpleble/simplebluez/src/interfaces/Battery1.cpp +30 -0
  254. data/vendor/simpleble/simplebluez/src/interfaces/Device1.cpp +170 -0
  255. data/vendor/simpleble/simplebluez/src/interfaces/GattCharacteristic1.cpp +118 -0
  256. data/vendor/simpleble/simplebluez/src/interfaces/GattDescriptor1.cpp +78 -0
  257. data/vendor/simpleble/simplebluez/src/interfaces/GattService1.cpp +28 -0
  258. data/vendor/simpleble/simplebluez/test/src/helpers/PythonRunner.cpp +53 -0
  259. data/vendor/simpleble/simplebluez/test/src/helpers/PythonRunner.h +24 -0
  260. data/vendor/simpleble/simplebluez/test/src/main.cpp +16 -0
  261. data/vendor/simpleble/simplecble/include/simplecble/adapter.h +188 -0
  262. data/vendor/simpleble/simplecble/include/simplecble/logging.h +37 -0
  263. data/vendor/simpleble/simplecble/include/simplecble/peripheral.h +304 -0
  264. data/vendor/simpleble/simplecble/include/simplecble/simpleble.h +21 -0
  265. data/vendor/simpleble/simplecble/include/simplecble/types.h +73 -0
  266. data/vendor/simpleble/simplecble/include/simplecble/utils.h +27 -0
  267. data/vendor/simpleble/simplecble/src/adapter.cpp +204 -0
  268. data/vendor/simpleble/simplecble/src/logging.cpp +19 -0
  269. data/vendor/simpleble/simplecble/src/peripheral.cpp +444 -0
  270. data/vendor/simpleble/simplecble/src/simpleble.cpp +5 -0
  271. data/vendor/simpleble/simplecble/src/utils.cpp +15 -0
  272. data/vendor/simpleble/simpledbus/include/simpledbus/advanced/Interface.h +67 -0
  273. data/vendor/simpleble/simpledbus/include/simpledbus/advanced/InterfaceRegistry.h +64 -0
  274. data/vendor/simpleble/simpledbus/include/simpledbus/advanced/Proxy.h +117 -0
  275. data/vendor/simpleble/simpledbus/include/simpledbus/base/Connection.h +50 -0
  276. data/vendor/simpleble/simpledbus/include/simpledbus/base/Exceptions.h +56 -0
  277. data/vendor/simpleble/simpledbus/include/simpledbus/base/Holder.h +147 -0
  278. data/vendor/simpleble/simpledbus/include/simpledbus/base/Logging.h +57 -0
  279. data/vendor/simpleble/simpledbus/include/simpledbus/base/Message.h +89 -0
  280. data/vendor/simpleble/simpledbus/include/simpledbus/base/Path.h +24 -0
  281. data/vendor/simpleble/simpledbus/include/simpledbus/interfaces/ObjectManager.h +26 -0
  282. data/vendor/simpleble/simpledbus/src/advanced/Interface.cpp +155 -0
  283. data/vendor/simpleble/simpledbus/src/advanced/Proxy.cpp +375 -0
  284. data/vendor/simpleble/simpledbus/src/base/Connection.cpp +222 -0
  285. data/vendor/simpleble/simpledbus/src/base/Exceptions.cpp +39 -0
  286. data/vendor/simpleble/simpledbus/src/base/Holder.cpp +739 -0
  287. data/vendor/simpleble/simpledbus/src/base/Logging.cpp +52 -0
  288. data/vendor/simpleble/simpledbus/src/base/Message.cpp +622 -0
  289. data/vendor/simpleble/simpledbus/src/base/Path.cpp +129 -0
  290. data/vendor/simpleble/simpledbus/src/interfaces/ObjectManager.cpp +58 -0
  291. data/vendor/simpleble/simpledbus/test/src/helpers/PythonRunner.cpp +53 -0
  292. data/vendor/simpleble/simpledbus/test/src/helpers/PythonRunner.h +24 -0
  293. data/vendor/simpleble/simpledbus/test/src/main.cpp +16 -0
  294. data/vendor/simpleble/simpledbus/test/src/test_holder.cpp +184 -0
  295. data/vendor/simpleble/simpledbus/test/src/test_message.cpp +397 -0
  296. data/vendor/simpleble/simpledbus/test/src/test_path.cpp +76 -0
  297. data/vendor/simpleble/simpledbus/test/src/test_proxy_children.cpp +109 -0
  298. data/vendor/simpleble/simpledbus/test/src/test_proxy_interfaces.cpp +102 -0
  299. data/vendor/simpleble/simpledbus/test/src/test_proxy_lifetime.cpp +18 -0
  300. data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/ThreadRunner.h +89 -0
  301. data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/android_utils.cpp +55 -0
  302. data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/android_utils.h +18 -0
  303. data/vendor/simpleble/simpledroidble/simpledroidble/src/main/cpp/simpleble_android.cpp +813 -0
  304. data/vendor/simpleble/simplejavable/cpp/src/core/AdapterWrapper.cpp +37 -0
  305. data/vendor/simpleble/simplejavable/cpp/src/core/AdapterWrapper.h +23 -0
  306. data/vendor/simpleble/simplejavable/cpp/src/core/Cache.cpp +58 -0
  307. data/vendor/simpleble/simplejavable/cpp/src/core/Cache.h +34 -0
  308. data/vendor/simpleble/simplejavable/cpp/src/core/PeripheralWrapper.cpp +17 -0
  309. data/vendor/simpleble/simplejavable/cpp/src/core/PeripheralWrapper.h +19 -0
  310. data/vendor/simpleble/simplejavable/cpp/src/java/lang/ArrayList.cpp +257 -0
  311. data/vendor/simpleble/simplejavable/cpp/src/java/lang/ArrayList.h +78 -0
  312. data/vendor/simpleble/simplejavable/cpp/src/java/lang/HashMap.cpp +96 -0
  313. data/vendor/simpleble/simplejavable/cpp/src/java/lang/HashMap.h +54 -0
  314. data/vendor/simpleble/simplejavable/cpp/src/java/lang/Integer.cpp +93 -0
  315. data/vendor/simpleble/simplejavable/cpp/src/java/lang/Integer.h +49 -0
  316. data/vendor/simpleble/simplejavable/cpp/src/java/lang/Iterator.cpp +85 -0
  317. data/vendor/simpleble/simplejavable/cpp/src/java/lang/Iterator.h +48 -0
  318. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/AdapterCallback.cpp +91 -0
  319. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/AdapterCallback.h +90 -0
  320. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Characteristic.cpp +35 -0
  321. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Characteristic.h +60 -0
  322. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/DataCallback.cpp +33 -0
  323. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/DataCallback.h +45 -0
  324. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Descriptor.cpp +30 -0
  325. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Descriptor.h +49 -0
  326. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/PeripheralCallback.cpp +41 -0
  327. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/PeripheralCallback.h +51 -0
  328. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Service.cpp +33 -0
  329. data/vendor/simpleble/simplejavable/cpp/src/org/simplejavable/Service.h +54 -0
  330. data/vendor/simpleble/simplejavable/cpp/src/simplejavable.cpp +361 -0
  331. data/vendor/simpleble/simplepyble/src/main.cpp +55 -0
  332. data/vendor/simpleble/simplepyble/src/wrap_adapter.cpp +106 -0
  333. data/vendor/simpleble/simplepyble/src/wrap_characteristic.cpp +56 -0
  334. data/vendor/simpleble/simplepyble/src/wrap_config.cpp +136 -0
  335. data/vendor/simpleble/simplepyble/src/wrap_descriptor.cpp +21 -0
  336. data/vendor/simpleble/simplepyble/src/wrap_peripheral.cpp +217 -0
  337. data/vendor/simpleble/simplepyble/src/wrap_service.cpp +32 -0
  338. data/vendor/simpleble/simplepyble/src/wrap_types.cpp +21 -0
  339. data/vendor/simpleble/simplersble/src/bindings/Bindings.cpp +338 -0
  340. data/vendor/simpleble/simplersble/src/bindings/Bindings.hpp +178 -0
  341. metadata +430 -0
@@ -0,0 +1,920 @@
1
+ /* This source file must have a .cpp extension so that all C++ compilers
2
+ recognize the extension without flags. Borland does not know .cxx for
3
+ example. */
4
+ #ifndef __cplusplus
5
+ # error "A C compiler has been selected for C++."
6
+ #endif
7
+
8
+ #if !defined(__has_include)
9
+ /* If the compiler does not have __has_include, pretend the answer is
10
+ always no. */
11
+ # define __has_include(x) 0
12
+ #endif
13
+
14
+
15
+ /* Version number components: V=Version, R=Revision, P=Patch
16
+ Version date components: YYYY=Year, MM=Month, DD=Day */
17
+
18
+ #if defined(__INTEL_COMPILER) || defined(__ICC)
19
+ # define COMPILER_ID "Intel"
20
+ # if defined(_MSC_VER)
21
+ # define SIMULATE_ID "MSVC"
22
+ # endif
23
+ # if defined(__GNUC__)
24
+ # define SIMULATE_ID "GNU"
25
+ # endif
26
+ /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
27
+ except that a few beta releases use the old format with V=2021. */
28
+ # if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
29
+ # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
30
+ # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
31
+ # if defined(__INTEL_COMPILER_UPDATE)
32
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
33
+ # else
34
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
35
+ # endif
36
+ # else
37
+ # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
38
+ # define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
39
+ /* The third version component from --version is an update index,
40
+ but no macro is provided for it. */
41
+ # define COMPILER_VERSION_PATCH DEC(0)
42
+ # endif
43
+ # if defined(__INTEL_COMPILER_BUILD_DATE)
44
+ /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
45
+ # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
46
+ # endif
47
+ # if defined(_MSC_VER)
48
+ /* _MSC_VER = VVRR */
49
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
50
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
51
+ # endif
52
+ # if defined(__GNUC__)
53
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
54
+ # elif defined(__GNUG__)
55
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
56
+ # endif
57
+ # if defined(__GNUC_MINOR__)
58
+ # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
59
+ # endif
60
+ # if defined(__GNUC_PATCHLEVEL__)
61
+ # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
62
+ # endif
63
+
64
+ #elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
65
+ # define COMPILER_ID "IntelLLVM"
66
+ #if defined(_MSC_VER)
67
+ # define SIMULATE_ID "MSVC"
68
+ #endif
69
+ #if defined(__GNUC__)
70
+ # define SIMULATE_ID "GNU"
71
+ #endif
72
+ /* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
73
+ * later. Look for 6 digit vs. 8 digit version number to decide encoding.
74
+ * VVVV is no smaller than the current year when a version is released.
75
+ */
76
+ #if __INTEL_LLVM_COMPILER < 1000000L
77
+ # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
78
+ # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
79
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
80
+ #else
81
+ # define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
82
+ # define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
83
+ # define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
84
+ #endif
85
+ #if defined(_MSC_VER)
86
+ /* _MSC_VER = VVRR */
87
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
88
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
89
+ #endif
90
+ #if defined(__GNUC__)
91
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
92
+ #elif defined(__GNUG__)
93
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
94
+ #endif
95
+ #if defined(__GNUC_MINOR__)
96
+ # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
97
+ #endif
98
+ #if defined(__GNUC_PATCHLEVEL__)
99
+ # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
100
+ #endif
101
+
102
+ #elif defined(__PATHCC__)
103
+ # define COMPILER_ID "PathScale"
104
+ # define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
105
+ # define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
106
+ # if defined(__PATHCC_PATCHLEVEL__)
107
+ # define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
108
+ # endif
109
+
110
+ #elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
111
+ # define COMPILER_ID "Embarcadero"
112
+ # define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
113
+ # define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
114
+ # define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
115
+
116
+ #elif defined(__BORLANDC__)
117
+ # define COMPILER_ID "Borland"
118
+ /* __BORLANDC__ = 0xVRR */
119
+ # define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
120
+ # define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
121
+
122
+ #elif defined(__WATCOMC__) && __WATCOMC__ < 1200
123
+ # define COMPILER_ID "Watcom"
124
+ /* __WATCOMC__ = VVRR */
125
+ # define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
126
+ # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
127
+ # if (__WATCOMC__ % 10) > 0
128
+ # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
129
+ # endif
130
+
131
+ #elif defined(__WATCOMC__)
132
+ # define COMPILER_ID "OpenWatcom"
133
+ /* __WATCOMC__ = VVRP + 1100 */
134
+ # define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
135
+ # define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
136
+ # if (__WATCOMC__ % 10) > 0
137
+ # define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
138
+ # endif
139
+
140
+ #elif defined(__SUNPRO_CC)
141
+ # define COMPILER_ID "SunPro"
142
+ # if __SUNPRO_CC >= 0x5100
143
+ /* __SUNPRO_CC = 0xVRRP */
144
+ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
145
+ # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
146
+ # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
147
+ # else
148
+ /* __SUNPRO_CC = 0xVRP */
149
+ # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
150
+ # define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
151
+ # define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
152
+ # endif
153
+
154
+ #elif defined(__HP_aCC)
155
+ # define COMPILER_ID "HP"
156
+ /* __HP_aCC = VVRRPP */
157
+ # define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
158
+ # define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
159
+ # define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
160
+
161
+ #elif defined(__DECCXX)
162
+ # define COMPILER_ID "Compaq"
163
+ /* __DECCXX_VER = VVRRTPPPP */
164
+ # define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
165
+ # define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
166
+ # define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
167
+
168
+ #elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
169
+ # define COMPILER_ID "zOS"
170
+ /* __IBMCPP__ = VRP */
171
+ # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
172
+ # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
173
+ # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
174
+
175
+ #elif defined(__open_xl__) && defined(__clang__)
176
+ # define COMPILER_ID "IBMClang"
177
+ # define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
178
+ # define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
179
+ # define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
180
+ # define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
181
+ # define COMPILER_VERSION_INTERNAL_STR __clang_version__
182
+
183
+
184
+ #elif defined(__ibmxl__) && defined(__clang__)
185
+ # define COMPILER_ID "XLClang"
186
+ # define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
187
+ # define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
188
+ # define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
189
+ # define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
190
+
191
+
192
+ #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
193
+ # define COMPILER_ID "XL"
194
+ /* __IBMCPP__ = VRP */
195
+ # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
196
+ # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
197
+ # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
198
+
199
+ #elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
200
+ # define COMPILER_ID "VisualAge"
201
+ /* __IBMCPP__ = VRP */
202
+ # define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
203
+ # define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
204
+ # define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
205
+
206
+ #elif defined(__NVCOMPILER)
207
+ # define COMPILER_ID "NVHPC"
208
+ # define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
209
+ # define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
210
+ # if defined(__NVCOMPILER_PATCHLEVEL__)
211
+ # define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
212
+ # endif
213
+
214
+ #elif defined(__PGI)
215
+ # define COMPILER_ID "PGI"
216
+ # define COMPILER_VERSION_MAJOR DEC(__PGIC__)
217
+ # define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
218
+ # if defined(__PGIC_PATCHLEVEL__)
219
+ # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
220
+ # endif
221
+
222
+ #elif defined(__clang__) && defined(__cray__)
223
+ # define COMPILER_ID "CrayClang"
224
+ # define COMPILER_VERSION_MAJOR DEC(__cray_major__)
225
+ # define COMPILER_VERSION_MINOR DEC(__cray_minor__)
226
+ # define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__)
227
+ # define COMPILER_VERSION_INTERNAL_STR __clang_version__
228
+
229
+
230
+ #elif defined(_CRAYC)
231
+ # define COMPILER_ID "Cray"
232
+ # define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
233
+ # define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
234
+
235
+ #elif defined(__TI_COMPILER_VERSION__)
236
+ # define COMPILER_ID "TI"
237
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
238
+ # define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
239
+ # define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
240
+ # define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
241
+
242
+ #elif defined(__CLANG_FUJITSU)
243
+ # define COMPILER_ID "FujitsuClang"
244
+ # define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
245
+ # define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
246
+ # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
247
+ # define COMPILER_VERSION_INTERNAL_STR __clang_version__
248
+
249
+
250
+ #elif defined(__FUJITSU)
251
+ # define COMPILER_ID "Fujitsu"
252
+ # if defined(__FCC_version__)
253
+ # define COMPILER_VERSION __FCC_version__
254
+ # elif defined(__FCC_major__)
255
+ # define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
256
+ # define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
257
+ # define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
258
+ # endif
259
+ # if defined(__fcc_version)
260
+ # define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
261
+ # elif defined(__FCC_VERSION)
262
+ # define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
263
+ # endif
264
+
265
+
266
+ #elif defined(__ghs__)
267
+ # define COMPILER_ID "GHS"
268
+ /* __GHS_VERSION_NUMBER = VVVVRP */
269
+ # ifdef __GHS_VERSION_NUMBER
270
+ # define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
271
+ # define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
272
+ # define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
273
+ # endif
274
+
275
+ #elif defined(__TASKING__)
276
+ # define COMPILER_ID "Tasking"
277
+ # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000)
278
+ # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100)
279
+ # define COMPILER_VERSION_INTERNAL DEC(__VERSION__)
280
+
281
+ #elif defined(__ORANGEC__)
282
+ # define COMPILER_ID "OrangeC"
283
+ # define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__)
284
+ # define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__)
285
+ # define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__)
286
+
287
+ #elif defined(__SCO_VERSION__)
288
+ # define COMPILER_ID "SCO"
289
+
290
+ #elif defined(__ARMCC_VERSION) && !defined(__clang__)
291
+ # define COMPILER_ID "ARMCC"
292
+ #if __ARMCC_VERSION >= 1000000
293
+ /* __ARMCC_VERSION = VRRPPPP */
294
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
295
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
296
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
297
+ #else
298
+ /* __ARMCC_VERSION = VRPPPP */
299
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
300
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
301
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
302
+ #endif
303
+
304
+
305
+ #elif defined(__clang__) && defined(__apple_build_version__)
306
+ # define COMPILER_ID "AppleClang"
307
+ # if defined(_MSC_VER)
308
+ # define SIMULATE_ID "MSVC"
309
+ # endif
310
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
311
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
312
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
313
+ # if defined(_MSC_VER)
314
+ /* _MSC_VER = VVRR */
315
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
316
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
317
+ # endif
318
+ # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
319
+
320
+ #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
321
+ # define COMPILER_ID "ARMClang"
322
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
323
+ # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
324
+ # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
325
+ # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
326
+
327
+ #elif defined(__clang__) && defined(__ti__)
328
+ # define COMPILER_ID "TIClang"
329
+ # define COMPILER_VERSION_MAJOR DEC(__ti_major__)
330
+ # define COMPILER_VERSION_MINOR DEC(__ti_minor__)
331
+ # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
332
+ # define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
333
+
334
+ #elif defined(__clang__)
335
+ # define COMPILER_ID "Clang"
336
+ # if defined(_MSC_VER)
337
+ # define SIMULATE_ID "MSVC"
338
+ # endif
339
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
340
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
341
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
342
+ # if defined(_MSC_VER)
343
+ /* _MSC_VER = VVRR */
344
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
345
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
346
+ # endif
347
+
348
+ #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
349
+ # define COMPILER_ID "LCC"
350
+ # define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
351
+ # define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
352
+ # if defined(__LCC_MINOR__)
353
+ # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
354
+ # endif
355
+ # if defined(__GNUC__) && defined(__GNUC_MINOR__)
356
+ # define SIMULATE_ID "GNU"
357
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
358
+ # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
359
+ # if defined(__GNUC_PATCHLEVEL__)
360
+ # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
361
+ # endif
362
+ # endif
363
+
364
+ #elif defined(__GNUC__) || defined(__GNUG__)
365
+ # define COMPILER_ID "GNU"
366
+ # if defined(__GNUC__)
367
+ # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
368
+ # else
369
+ # define COMPILER_VERSION_MAJOR DEC(__GNUG__)
370
+ # endif
371
+ # if defined(__GNUC_MINOR__)
372
+ # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
373
+ # endif
374
+ # if defined(__GNUC_PATCHLEVEL__)
375
+ # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
376
+ # endif
377
+
378
+ #elif defined(_MSC_VER)
379
+ # define COMPILER_ID "MSVC"
380
+ /* _MSC_VER = VVRR */
381
+ # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
382
+ # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
383
+ # if defined(_MSC_FULL_VER)
384
+ # if _MSC_VER >= 1400
385
+ /* _MSC_FULL_VER = VVRRPPPPP */
386
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
387
+ # else
388
+ /* _MSC_FULL_VER = VVRRPPPP */
389
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
390
+ # endif
391
+ # endif
392
+ # if defined(_MSC_BUILD)
393
+ # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
394
+ # endif
395
+
396
+ #elif defined(_ADI_COMPILER)
397
+ # define COMPILER_ID "ADSP"
398
+ #if defined(__VERSIONNUM__)
399
+ /* __VERSIONNUM__ = 0xVVRRPPTT */
400
+ # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
401
+ # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
402
+ # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
403
+ # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
404
+ #endif
405
+
406
+ #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
407
+ # define COMPILER_ID "IAR"
408
+ # if defined(__VER__) && defined(__ICCARM__)
409
+ # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
410
+ # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
411
+ # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
412
+ # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
413
+ # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
414
+ # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
415
+ # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
416
+ # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
417
+ # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
418
+ # endif
419
+
420
+
421
+ /* These compilers are either not known or too old to define an
422
+ identification macro. Try to identify the platform and guess that
423
+ it is the native compiler. */
424
+ #elif defined(__hpux) || defined(__hpua)
425
+ # define COMPILER_ID "HP"
426
+
427
+ #else /* unknown compiler */
428
+ # define COMPILER_ID ""
429
+ #endif
430
+
431
+ /* Construct the string literal in pieces to prevent the source from
432
+ getting matched. Store it in a pointer rather than an array
433
+ because some compilers will just produce instructions to fill the
434
+ array rather than assigning a pointer to a static array. */
435
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
436
+ #ifdef SIMULATE_ID
437
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
438
+ #endif
439
+
440
+ #ifdef __QNXNTO__
441
+ char const* qnxnto = "INFO" ":" "qnxnto[]";
442
+ #endif
443
+
444
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
445
+ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
446
+ #endif
447
+
448
+ #define STRINGIFY_HELPER(X) #X
449
+ #define STRINGIFY(X) STRINGIFY_HELPER(X)
450
+
451
+ /* Identify known platforms by name. */
452
+ #if defined(__linux) || defined(__linux__) || defined(linux)
453
+ # define PLATFORM_ID "Linux"
454
+
455
+ #elif defined(__MSYS__)
456
+ # define PLATFORM_ID "MSYS"
457
+
458
+ #elif defined(__CYGWIN__)
459
+ # define PLATFORM_ID "Cygwin"
460
+
461
+ #elif defined(__MINGW32__)
462
+ # define PLATFORM_ID "MinGW"
463
+
464
+ #elif defined(__APPLE__)
465
+ # define PLATFORM_ID "Darwin"
466
+
467
+ #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
468
+ # define PLATFORM_ID "Windows"
469
+
470
+ #elif defined(__FreeBSD__) || defined(__FreeBSD)
471
+ # define PLATFORM_ID "FreeBSD"
472
+
473
+ #elif defined(__NetBSD__) || defined(__NetBSD)
474
+ # define PLATFORM_ID "NetBSD"
475
+
476
+ #elif defined(__OpenBSD__) || defined(__OPENBSD)
477
+ # define PLATFORM_ID "OpenBSD"
478
+
479
+ #elif defined(__sun) || defined(sun)
480
+ # define PLATFORM_ID "SunOS"
481
+
482
+ #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
483
+ # define PLATFORM_ID "AIX"
484
+
485
+ #elif defined(__hpux) || defined(__hpux__)
486
+ # define PLATFORM_ID "HP-UX"
487
+
488
+ #elif defined(__HAIKU__)
489
+ # define PLATFORM_ID "Haiku"
490
+
491
+ #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
492
+ # define PLATFORM_ID "BeOS"
493
+
494
+ #elif defined(__QNX__) || defined(__QNXNTO__)
495
+ # define PLATFORM_ID "QNX"
496
+
497
+ #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
498
+ # define PLATFORM_ID "Tru64"
499
+
500
+ #elif defined(__riscos) || defined(__riscos__)
501
+ # define PLATFORM_ID "RISCos"
502
+
503
+ #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
504
+ # define PLATFORM_ID "SINIX"
505
+
506
+ #elif defined(__UNIX_SV__)
507
+ # define PLATFORM_ID "UNIX_SV"
508
+
509
+ #elif defined(__bsdos__)
510
+ # define PLATFORM_ID "BSDOS"
511
+
512
+ #elif defined(_MPRAS) || defined(MPRAS)
513
+ # define PLATFORM_ID "MP-RAS"
514
+
515
+ #elif defined(__osf) || defined(__osf__)
516
+ # define PLATFORM_ID "OSF1"
517
+
518
+ #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
519
+ # define PLATFORM_ID "SCO_SV"
520
+
521
+ #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
522
+ # define PLATFORM_ID "ULTRIX"
523
+
524
+ #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
525
+ # define PLATFORM_ID "Xenix"
526
+
527
+ #elif defined(__WATCOMC__)
528
+ # if defined(__LINUX__)
529
+ # define PLATFORM_ID "Linux"
530
+
531
+ # elif defined(__DOS__)
532
+ # define PLATFORM_ID "DOS"
533
+
534
+ # elif defined(__OS2__)
535
+ # define PLATFORM_ID "OS2"
536
+
537
+ # elif defined(__WINDOWS__)
538
+ # define PLATFORM_ID "Windows3x"
539
+
540
+ # elif defined(__VXWORKS__)
541
+ # define PLATFORM_ID "VxWorks"
542
+
543
+ # else /* unknown platform */
544
+ # define PLATFORM_ID
545
+ # endif
546
+
547
+ #elif defined(__INTEGRITY)
548
+ # if defined(INT_178B)
549
+ # define PLATFORM_ID "Integrity178"
550
+
551
+ # else /* regular Integrity */
552
+ # define PLATFORM_ID "Integrity"
553
+ # endif
554
+
555
+ # elif defined(_ADI_COMPILER)
556
+ # define PLATFORM_ID "ADSP"
557
+
558
+ #else /* unknown platform */
559
+ # define PLATFORM_ID
560
+
561
+ #endif
562
+
563
+ /* For windows compilers MSVC and Intel we can determine
564
+ the architecture of the compiler being used. This is because
565
+ the compilers do not have flags that can change the architecture,
566
+ but rather depend on which compiler is being used
567
+ */
568
+ #if defined(_WIN32) && defined(_MSC_VER)
569
+ # if defined(_M_IA64)
570
+ # define ARCHITECTURE_ID "IA64"
571
+
572
+ # elif defined(_M_ARM64EC)
573
+ # define ARCHITECTURE_ID "ARM64EC"
574
+
575
+ # elif defined(_M_X64) || defined(_M_AMD64)
576
+ # define ARCHITECTURE_ID "x64"
577
+
578
+ # elif defined(_M_IX86)
579
+ # define ARCHITECTURE_ID "X86"
580
+
581
+ # elif defined(_M_ARM64)
582
+ # define ARCHITECTURE_ID "ARM64"
583
+
584
+ # elif defined(_M_ARM)
585
+ # if _M_ARM == 4
586
+ # define ARCHITECTURE_ID "ARMV4I"
587
+ # elif _M_ARM == 5
588
+ # define ARCHITECTURE_ID "ARMV5I"
589
+ # else
590
+ # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
591
+ # endif
592
+
593
+ # elif defined(_M_MIPS)
594
+ # define ARCHITECTURE_ID "MIPS"
595
+
596
+ # elif defined(_M_SH)
597
+ # define ARCHITECTURE_ID "SHx"
598
+
599
+ # else /* unknown architecture */
600
+ # define ARCHITECTURE_ID ""
601
+ # endif
602
+
603
+ #elif defined(__WATCOMC__)
604
+ # if defined(_M_I86)
605
+ # define ARCHITECTURE_ID "I86"
606
+
607
+ # elif defined(_M_IX86)
608
+ # define ARCHITECTURE_ID "X86"
609
+
610
+ # else /* unknown architecture */
611
+ # define ARCHITECTURE_ID ""
612
+ # endif
613
+
614
+ #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
615
+ # if defined(__ICCARM__)
616
+ # define ARCHITECTURE_ID "ARM"
617
+
618
+ # elif defined(__ICCRX__)
619
+ # define ARCHITECTURE_ID "RX"
620
+
621
+ # elif defined(__ICCRH850__)
622
+ # define ARCHITECTURE_ID "RH850"
623
+
624
+ # elif defined(__ICCRL78__)
625
+ # define ARCHITECTURE_ID "RL78"
626
+
627
+ # elif defined(__ICCRISCV__)
628
+ # define ARCHITECTURE_ID "RISCV"
629
+
630
+ # elif defined(__ICCAVR__)
631
+ # define ARCHITECTURE_ID "AVR"
632
+
633
+ # elif defined(__ICC430__)
634
+ # define ARCHITECTURE_ID "MSP430"
635
+
636
+ # elif defined(__ICCV850__)
637
+ # define ARCHITECTURE_ID "V850"
638
+
639
+ # elif defined(__ICC8051__)
640
+ # define ARCHITECTURE_ID "8051"
641
+
642
+ # elif defined(__ICCSTM8__)
643
+ # define ARCHITECTURE_ID "STM8"
644
+
645
+ # else /* unknown architecture */
646
+ # define ARCHITECTURE_ID ""
647
+ # endif
648
+
649
+ #elif defined(__ghs__)
650
+ # if defined(__PPC64__)
651
+ # define ARCHITECTURE_ID "PPC64"
652
+
653
+ # elif defined(__ppc__)
654
+ # define ARCHITECTURE_ID "PPC"
655
+
656
+ # elif defined(__ARM__)
657
+ # define ARCHITECTURE_ID "ARM"
658
+
659
+ # elif defined(__x86_64__)
660
+ # define ARCHITECTURE_ID "x64"
661
+
662
+ # elif defined(__i386__)
663
+ # define ARCHITECTURE_ID "X86"
664
+
665
+ # else /* unknown architecture */
666
+ # define ARCHITECTURE_ID ""
667
+ # endif
668
+
669
+ #elif defined(__clang__) && defined(__ti__)
670
+ # if defined(__ARM_ARCH)
671
+ # define ARCHITECTURE_ID "ARM"
672
+
673
+ # else /* unknown architecture */
674
+ # define ARCHITECTURE_ID ""
675
+ # endif
676
+
677
+ #elif defined(__TI_COMPILER_VERSION__)
678
+ # if defined(__TI_ARM__)
679
+ # define ARCHITECTURE_ID "ARM"
680
+
681
+ # elif defined(__MSP430__)
682
+ # define ARCHITECTURE_ID "MSP430"
683
+
684
+ # elif defined(__TMS320C28XX__)
685
+ # define ARCHITECTURE_ID "TMS320C28x"
686
+
687
+ # elif defined(__TMS320C6X__) || defined(_TMS320C6X)
688
+ # define ARCHITECTURE_ID "TMS320C6x"
689
+
690
+ # else /* unknown architecture */
691
+ # define ARCHITECTURE_ID ""
692
+ # endif
693
+
694
+ # elif defined(__ADSPSHARC__)
695
+ # define ARCHITECTURE_ID "SHARC"
696
+
697
+ # elif defined(__ADSPBLACKFIN__)
698
+ # define ARCHITECTURE_ID "Blackfin"
699
+
700
+ #elif defined(__TASKING__)
701
+
702
+ # if defined(__CTC__) || defined(__CPTC__)
703
+ # define ARCHITECTURE_ID "TriCore"
704
+
705
+ # elif defined(__CMCS__)
706
+ # define ARCHITECTURE_ID "MCS"
707
+
708
+ # elif defined(__CARM__) || defined(__CPARM__)
709
+ # define ARCHITECTURE_ID "ARM"
710
+
711
+ # elif defined(__CARC__)
712
+ # define ARCHITECTURE_ID "ARC"
713
+
714
+ # elif defined(__C51__)
715
+ # define ARCHITECTURE_ID "8051"
716
+
717
+ # elif defined(__CPCP__)
718
+ # define ARCHITECTURE_ID "PCP"
719
+
720
+ # else
721
+ # define ARCHITECTURE_ID ""
722
+ # endif
723
+
724
+ #else
725
+ # define ARCHITECTURE_ID
726
+ #endif
727
+
728
+ /* Convert integer to decimal digit literals. */
729
+ #define DEC(n) \
730
+ ('0' + (((n) / 10000000)%10)), \
731
+ ('0' + (((n) / 1000000)%10)), \
732
+ ('0' + (((n) / 100000)%10)), \
733
+ ('0' + (((n) / 10000)%10)), \
734
+ ('0' + (((n) / 1000)%10)), \
735
+ ('0' + (((n) / 100)%10)), \
736
+ ('0' + (((n) / 10)%10)), \
737
+ ('0' + ((n) % 10))
738
+
739
+ /* Convert integer to hex digit literals. */
740
+ #define HEX(n) \
741
+ ('0' + ((n)>>28 & 0xF)), \
742
+ ('0' + ((n)>>24 & 0xF)), \
743
+ ('0' + ((n)>>20 & 0xF)), \
744
+ ('0' + ((n)>>16 & 0xF)), \
745
+ ('0' + ((n)>>12 & 0xF)), \
746
+ ('0' + ((n)>>8 & 0xF)), \
747
+ ('0' + ((n)>>4 & 0xF)), \
748
+ ('0' + ((n) & 0xF))
749
+
750
+ /* Construct a string literal encoding the version number. */
751
+ #ifdef COMPILER_VERSION
752
+ char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
753
+
754
+ /* Construct a string literal encoding the version number components. */
755
+ #elif defined(COMPILER_VERSION_MAJOR)
756
+ char const info_version[] = {
757
+ 'I', 'N', 'F', 'O', ':',
758
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
759
+ COMPILER_VERSION_MAJOR,
760
+ # ifdef COMPILER_VERSION_MINOR
761
+ '.', COMPILER_VERSION_MINOR,
762
+ # ifdef COMPILER_VERSION_PATCH
763
+ '.', COMPILER_VERSION_PATCH,
764
+ # ifdef COMPILER_VERSION_TWEAK
765
+ '.', COMPILER_VERSION_TWEAK,
766
+ # endif
767
+ # endif
768
+ # endif
769
+ ']','\0'};
770
+ #endif
771
+
772
+ /* Construct a string literal encoding the internal version number. */
773
+ #ifdef COMPILER_VERSION_INTERNAL
774
+ char const info_version_internal[] = {
775
+ 'I', 'N', 'F', 'O', ':',
776
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
777
+ 'i','n','t','e','r','n','a','l','[',
778
+ COMPILER_VERSION_INTERNAL,']','\0'};
779
+ #elif defined(COMPILER_VERSION_INTERNAL_STR)
780
+ char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
781
+ #endif
782
+
783
+ /* Construct a string literal encoding the version number components. */
784
+ #ifdef SIMULATE_VERSION_MAJOR
785
+ char const info_simulate_version[] = {
786
+ 'I', 'N', 'F', 'O', ':',
787
+ 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
788
+ SIMULATE_VERSION_MAJOR,
789
+ # ifdef SIMULATE_VERSION_MINOR
790
+ '.', SIMULATE_VERSION_MINOR,
791
+ # ifdef SIMULATE_VERSION_PATCH
792
+ '.', SIMULATE_VERSION_PATCH,
793
+ # ifdef SIMULATE_VERSION_TWEAK
794
+ '.', SIMULATE_VERSION_TWEAK,
795
+ # endif
796
+ # endif
797
+ # endif
798
+ ']','\0'};
799
+ #endif
800
+
801
+ /* Construct the string literal in pieces to prevent the source from
802
+ getting matched. Store it in a pointer rather than an array
803
+ because some compilers will just produce instructions to fill the
804
+ array rather than assigning a pointer to a static array. */
805
+ char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
806
+ char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
807
+
808
+
809
+
810
+ #define CXX_STD_98 199711L
811
+ #define CXX_STD_11 201103L
812
+ #define CXX_STD_14 201402L
813
+ #define CXX_STD_17 201703L
814
+ #define CXX_STD_20 202002L
815
+ #define CXX_STD_23 202302L
816
+
817
+ #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
818
+ # if _MSVC_LANG > CXX_STD_17
819
+ # define CXX_STD _MSVC_LANG
820
+ # elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
821
+ # define CXX_STD CXX_STD_20
822
+ # elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
823
+ # define CXX_STD CXX_STD_20
824
+ # elif _MSVC_LANG > CXX_STD_14
825
+ # define CXX_STD CXX_STD_17
826
+ # elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
827
+ # define CXX_STD CXX_STD_14
828
+ # elif defined(__INTEL_CXX11_MODE__)
829
+ # define CXX_STD CXX_STD_11
830
+ # else
831
+ # define CXX_STD CXX_STD_98
832
+ # endif
833
+ #elif defined(_MSC_VER) && defined(_MSVC_LANG)
834
+ # if _MSVC_LANG > __cplusplus
835
+ # define CXX_STD _MSVC_LANG
836
+ # else
837
+ # define CXX_STD __cplusplus
838
+ # endif
839
+ #elif defined(__NVCOMPILER)
840
+ # if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
841
+ # define CXX_STD CXX_STD_20
842
+ # else
843
+ # define CXX_STD __cplusplus
844
+ # endif
845
+ #elif defined(__INTEL_COMPILER) || defined(__PGI)
846
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
847
+ # define CXX_STD CXX_STD_17
848
+ # elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
849
+ # define CXX_STD CXX_STD_14
850
+ # else
851
+ # define CXX_STD __cplusplus
852
+ # endif
853
+ #elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
854
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
855
+ # define CXX_STD CXX_STD_14
856
+ # else
857
+ # define CXX_STD __cplusplus
858
+ # endif
859
+ #elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
860
+ # define CXX_STD CXX_STD_11
861
+ #else
862
+ # define CXX_STD __cplusplus
863
+ #endif
864
+
865
+ const char* info_language_standard_default = "INFO" ":" "standard_default["
866
+ #if CXX_STD > CXX_STD_23
867
+ "26"
868
+ #elif CXX_STD > CXX_STD_20
869
+ "23"
870
+ #elif CXX_STD > CXX_STD_17
871
+ "20"
872
+ #elif CXX_STD > CXX_STD_14
873
+ "17"
874
+ #elif CXX_STD > CXX_STD_11
875
+ "14"
876
+ #elif CXX_STD >= CXX_STD_11
877
+ "11"
878
+ #else
879
+ "98"
880
+ #endif
881
+ "]";
882
+
883
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
884
+ #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
885
+ defined(__TI_COMPILER_VERSION__)) && \
886
+ !defined(__STRICT_ANSI__)
887
+ "ON"
888
+ #else
889
+ "OFF"
890
+ #endif
891
+ "]";
892
+
893
+ /*--------------------------------------------------------------------------*/
894
+
895
+ int main(int argc, char* argv[])
896
+ {
897
+ int require = 0;
898
+ require += info_compiler[argc];
899
+ require += info_platform[argc];
900
+ require += info_arch[argc];
901
+ #ifdef COMPILER_VERSION_MAJOR
902
+ require += info_version[argc];
903
+ #endif
904
+ #if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
905
+ require += info_version_internal[argc];
906
+ #endif
907
+ #ifdef SIMULATE_ID
908
+ require += info_simulate[argc];
909
+ #endif
910
+ #ifdef SIMULATE_VERSION_MAJOR
911
+ require += info_simulate_version[argc];
912
+ #endif
913
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
914
+ require += info_cray[argc];
915
+ #endif
916
+ require += info_language_standard_default[argc];
917
+ require += info_language_extensions_default[argc];
918
+ (void)argv;
919
+ return require;
920
+ }