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,949 @@
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(__RENESAS__)
288
+ # define COMPILER_ID "Renesas"
289
+ /* __RENESAS_VERSION__ = 0xVVRRPP00 */
290
+ # define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF)
291
+ # define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF)
292
+ # define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF)
293
+
294
+ #elif defined(__SCO_VERSION__)
295
+ # define COMPILER_ID "SCO"
296
+
297
+ #elif defined(__ARMCC_VERSION) && !defined(__clang__)
298
+ # define COMPILER_ID "ARMCC"
299
+ #if __ARMCC_VERSION >= 1000000
300
+ /* __ARMCC_VERSION = VRRPPPP */
301
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
302
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
303
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
304
+ #else
305
+ /* __ARMCC_VERSION = VRPPPP */
306
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
307
+ # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
308
+ # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
309
+ #endif
310
+
311
+
312
+ #elif defined(__clang__) && defined(__apple_build_version__)
313
+ # define COMPILER_ID "AppleClang"
314
+ # if defined(_MSC_VER)
315
+ # define SIMULATE_ID "MSVC"
316
+ # endif
317
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
318
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
319
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
320
+ # if defined(_MSC_VER)
321
+ /* _MSC_VER = VVRR */
322
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
323
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
324
+ # endif
325
+ # define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
326
+
327
+ #elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
328
+ # define COMPILER_ID "ARMClang"
329
+ # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
330
+ # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
331
+ # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100)
332
+ # define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
333
+
334
+ #elif defined(__clang__) && defined(__ti__)
335
+ # define COMPILER_ID "TIClang"
336
+ # define COMPILER_VERSION_MAJOR DEC(__ti_major__)
337
+ # define COMPILER_VERSION_MINOR DEC(__ti_minor__)
338
+ # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__)
339
+ # define COMPILER_VERSION_INTERNAL DEC(__ti_version__)
340
+
341
+ #elif defined(__clang__)
342
+ # define COMPILER_ID "Clang"
343
+ # if defined(_MSC_VER)
344
+ # define SIMULATE_ID "MSVC"
345
+ # endif
346
+ # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
347
+ # define COMPILER_VERSION_MINOR DEC(__clang_minor__)
348
+ # define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
349
+ # if defined(_MSC_VER)
350
+ /* _MSC_VER = VVRR */
351
+ # define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
352
+ # define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
353
+ # endif
354
+
355
+ #elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
356
+ # define COMPILER_ID "LCC"
357
+ # define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100)
358
+ # define COMPILER_VERSION_MINOR DEC(__LCC__ % 100)
359
+ # if defined(__LCC_MINOR__)
360
+ # define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
361
+ # endif
362
+ # if defined(__GNUC__) && defined(__GNUC_MINOR__)
363
+ # define SIMULATE_ID "GNU"
364
+ # define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
365
+ # define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
366
+ # if defined(__GNUC_PATCHLEVEL__)
367
+ # define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
368
+ # endif
369
+ # endif
370
+
371
+ #elif defined(__GNUC__) || defined(__GNUG__)
372
+ # define COMPILER_ID "GNU"
373
+ # if defined(__GNUC__)
374
+ # define COMPILER_VERSION_MAJOR DEC(__GNUC__)
375
+ # else
376
+ # define COMPILER_VERSION_MAJOR DEC(__GNUG__)
377
+ # endif
378
+ # if defined(__GNUC_MINOR__)
379
+ # define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
380
+ # endif
381
+ # if defined(__GNUC_PATCHLEVEL__)
382
+ # define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
383
+ # endif
384
+
385
+ #elif defined(_MSC_VER)
386
+ # define COMPILER_ID "MSVC"
387
+ /* _MSC_VER = VVRR */
388
+ # define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
389
+ # define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
390
+ # if defined(_MSC_FULL_VER)
391
+ # if _MSC_VER >= 1400
392
+ /* _MSC_FULL_VER = VVRRPPPPP */
393
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
394
+ # else
395
+ /* _MSC_FULL_VER = VVRRPPPP */
396
+ # define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
397
+ # endif
398
+ # endif
399
+ # if defined(_MSC_BUILD)
400
+ # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
401
+ # endif
402
+
403
+ #elif defined(_ADI_COMPILER)
404
+ # define COMPILER_ID "ADSP"
405
+ #if defined(__VERSIONNUM__)
406
+ /* __VERSIONNUM__ = 0xVVRRPPTT */
407
+ # define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
408
+ # define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
409
+ # define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
410
+ # define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
411
+ #endif
412
+
413
+ #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
414
+ # define COMPILER_ID "IAR"
415
+ # if defined(__VER__) && defined(__ICCARM__)
416
+ # define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
417
+ # define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
418
+ # define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
419
+ # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
420
+ # elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
421
+ # define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
422
+ # define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
423
+ # define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
424
+ # define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
425
+ # endif
426
+
427
+ #elif defined(__DCC__) && defined(_DIAB_TOOL)
428
+ # define COMPILER_ID "Diab"
429
+ # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__)
430
+ # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__)
431
+ # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__)
432
+ # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__)
433
+
434
+
435
+
436
+ /* These compilers are either not known or too old to define an
437
+ identification macro. Try to identify the platform and guess that
438
+ it is the native compiler. */
439
+ #elif defined(__hpux) || defined(__hpua)
440
+ # define COMPILER_ID "HP"
441
+
442
+ #else /* unknown compiler */
443
+ # define COMPILER_ID ""
444
+ #endif
445
+
446
+ /* Construct the string literal in pieces to prevent the source from
447
+ getting matched. Store it in a pointer rather than an array
448
+ because some compilers will just produce instructions to fill the
449
+ array rather than assigning a pointer to a static array. */
450
+ char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
451
+ #ifdef SIMULATE_ID
452
+ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
453
+ #endif
454
+
455
+ #ifdef __QNXNTO__
456
+ char const* qnxnto = "INFO" ":" "qnxnto[]";
457
+ #endif
458
+
459
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
460
+ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
461
+ #endif
462
+
463
+ #define STRINGIFY_HELPER(X) #X
464
+ #define STRINGIFY(X) STRINGIFY_HELPER(X)
465
+
466
+ /* Identify known platforms by name. */
467
+ #if defined(__linux) || defined(__linux__) || defined(linux)
468
+ # define PLATFORM_ID "Linux"
469
+
470
+ #elif defined(__MSYS__)
471
+ # define PLATFORM_ID "MSYS"
472
+
473
+ #elif defined(__CYGWIN__)
474
+ # define PLATFORM_ID "Cygwin"
475
+
476
+ #elif defined(__MINGW32__)
477
+ # define PLATFORM_ID "MinGW"
478
+
479
+ #elif defined(__APPLE__)
480
+ # define PLATFORM_ID "Darwin"
481
+
482
+ #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
483
+ # define PLATFORM_ID "Windows"
484
+
485
+ #elif defined(__FreeBSD__) || defined(__FreeBSD)
486
+ # define PLATFORM_ID "FreeBSD"
487
+
488
+ #elif defined(__NetBSD__) || defined(__NetBSD)
489
+ # define PLATFORM_ID "NetBSD"
490
+
491
+ #elif defined(__OpenBSD__) || defined(__OPENBSD)
492
+ # define PLATFORM_ID "OpenBSD"
493
+
494
+ #elif defined(__sun) || defined(sun)
495
+ # define PLATFORM_ID "SunOS"
496
+
497
+ #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
498
+ # define PLATFORM_ID "AIX"
499
+
500
+ #elif defined(__hpux) || defined(__hpux__)
501
+ # define PLATFORM_ID "HP-UX"
502
+
503
+ #elif defined(__HAIKU__)
504
+ # define PLATFORM_ID "Haiku"
505
+
506
+ #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
507
+ # define PLATFORM_ID "BeOS"
508
+
509
+ #elif defined(__QNX__) || defined(__QNXNTO__)
510
+ # define PLATFORM_ID "QNX"
511
+
512
+ #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
513
+ # define PLATFORM_ID "Tru64"
514
+
515
+ #elif defined(__riscos) || defined(__riscos__)
516
+ # define PLATFORM_ID "RISCos"
517
+
518
+ #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
519
+ # define PLATFORM_ID "SINIX"
520
+
521
+ #elif defined(__UNIX_SV__)
522
+ # define PLATFORM_ID "UNIX_SV"
523
+
524
+ #elif defined(__bsdos__)
525
+ # define PLATFORM_ID "BSDOS"
526
+
527
+ #elif defined(_MPRAS) || defined(MPRAS)
528
+ # define PLATFORM_ID "MP-RAS"
529
+
530
+ #elif defined(__osf) || defined(__osf__)
531
+ # define PLATFORM_ID "OSF1"
532
+
533
+ #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
534
+ # define PLATFORM_ID "SCO_SV"
535
+
536
+ #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
537
+ # define PLATFORM_ID "ULTRIX"
538
+
539
+ #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
540
+ # define PLATFORM_ID "Xenix"
541
+
542
+ #elif defined(__WATCOMC__)
543
+ # if defined(__LINUX__)
544
+ # define PLATFORM_ID "Linux"
545
+
546
+ # elif defined(__DOS__)
547
+ # define PLATFORM_ID "DOS"
548
+
549
+ # elif defined(__OS2__)
550
+ # define PLATFORM_ID "OS2"
551
+
552
+ # elif defined(__WINDOWS__)
553
+ # define PLATFORM_ID "Windows3x"
554
+
555
+ # elif defined(__VXWORKS__)
556
+ # define PLATFORM_ID "VxWorks"
557
+
558
+ # else /* unknown platform */
559
+ # define PLATFORM_ID
560
+ # endif
561
+
562
+ #elif defined(__INTEGRITY)
563
+ # if defined(INT_178B)
564
+ # define PLATFORM_ID "Integrity178"
565
+
566
+ # else /* regular Integrity */
567
+ # define PLATFORM_ID "Integrity"
568
+ # endif
569
+
570
+ # elif defined(_ADI_COMPILER)
571
+ # define PLATFORM_ID "ADSP"
572
+
573
+ #else /* unknown platform */
574
+ # define PLATFORM_ID
575
+
576
+ #endif
577
+
578
+ /* For windows compilers MSVC and Intel we can determine
579
+ the architecture of the compiler being used. This is because
580
+ the compilers do not have flags that can change the architecture,
581
+ but rather depend on which compiler is being used
582
+ */
583
+ #if defined(_WIN32) && defined(_MSC_VER)
584
+ # if defined(_M_IA64)
585
+ # define ARCHITECTURE_ID "IA64"
586
+
587
+ # elif defined(_M_ARM64EC)
588
+ # define ARCHITECTURE_ID "ARM64EC"
589
+
590
+ # elif defined(_M_X64) || defined(_M_AMD64)
591
+ # define ARCHITECTURE_ID "x64"
592
+
593
+ # elif defined(_M_IX86)
594
+ # define ARCHITECTURE_ID "X86"
595
+
596
+ # elif defined(_M_ARM64)
597
+ # define ARCHITECTURE_ID "ARM64"
598
+
599
+ # elif defined(_M_ARM)
600
+ # if _M_ARM == 4
601
+ # define ARCHITECTURE_ID "ARMV4I"
602
+ # elif _M_ARM == 5
603
+ # define ARCHITECTURE_ID "ARMV5I"
604
+ # else
605
+ # define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
606
+ # endif
607
+
608
+ # elif defined(_M_MIPS)
609
+ # define ARCHITECTURE_ID "MIPS"
610
+
611
+ # elif defined(_M_SH)
612
+ # define ARCHITECTURE_ID "SHx"
613
+
614
+ # else /* unknown architecture */
615
+ # define ARCHITECTURE_ID ""
616
+ # endif
617
+
618
+ #elif defined(__WATCOMC__)
619
+ # if defined(_M_I86)
620
+ # define ARCHITECTURE_ID "I86"
621
+
622
+ # elif defined(_M_IX86)
623
+ # define ARCHITECTURE_ID "X86"
624
+
625
+ # else /* unknown architecture */
626
+ # define ARCHITECTURE_ID ""
627
+ # endif
628
+
629
+ #elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
630
+ # if defined(__ICCARM__)
631
+ # define ARCHITECTURE_ID "ARM"
632
+
633
+ # elif defined(__ICCRX__)
634
+ # define ARCHITECTURE_ID "RX"
635
+
636
+ # elif defined(__ICCRH850__)
637
+ # define ARCHITECTURE_ID "RH850"
638
+
639
+ # elif defined(__ICCRL78__)
640
+ # define ARCHITECTURE_ID "RL78"
641
+
642
+ # elif defined(__ICCRISCV__)
643
+ # define ARCHITECTURE_ID "RISCV"
644
+
645
+ # elif defined(__ICCAVR__)
646
+ # define ARCHITECTURE_ID "AVR"
647
+
648
+ # elif defined(__ICC430__)
649
+ # define ARCHITECTURE_ID "MSP430"
650
+
651
+ # elif defined(__ICCV850__)
652
+ # define ARCHITECTURE_ID "V850"
653
+
654
+ # elif defined(__ICC8051__)
655
+ # define ARCHITECTURE_ID "8051"
656
+
657
+ # elif defined(__ICCSTM8__)
658
+ # define ARCHITECTURE_ID "STM8"
659
+
660
+ # else /* unknown architecture */
661
+ # define ARCHITECTURE_ID ""
662
+ # endif
663
+
664
+ #elif defined(__ghs__)
665
+ # if defined(__PPC64__)
666
+ # define ARCHITECTURE_ID "PPC64"
667
+
668
+ # elif defined(__ppc__)
669
+ # define ARCHITECTURE_ID "PPC"
670
+
671
+ # elif defined(__ARM__)
672
+ # define ARCHITECTURE_ID "ARM"
673
+
674
+ # elif defined(__x86_64__)
675
+ # define ARCHITECTURE_ID "x64"
676
+
677
+ # elif defined(__i386__)
678
+ # define ARCHITECTURE_ID "X86"
679
+
680
+ # else /* unknown architecture */
681
+ # define ARCHITECTURE_ID ""
682
+ # endif
683
+
684
+ #elif defined(__clang__) && defined(__ti__)
685
+ # if defined(__ARM_ARCH)
686
+ # define ARCHITECTURE_ID "ARM"
687
+
688
+ # else /* unknown architecture */
689
+ # define ARCHITECTURE_ID ""
690
+ # endif
691
+
692
+ #elif defined(__TI_COMPILER_VERSION__)
693
+ # if defined(__TI_ARM__)
694
+ # define ARCHITECTURE_ID "ARM"
695
+
696
+ # elif defined(__MSP430__)
697
+ # define ARCHITECTURE_ID "MSP430"
698
+
699
+ # elif defined(__TMS320C28XX__)
700
+ # define ARCHITECTURE_ID "TMS320C28x"
701
+
702
+ # elif defined(__TMS320C6X__) || defined(_TMS320C6X)
703
+ # define ARCHITECTURE_ID "TMS320C6x"
704
+
705
+ # else /* unknown architecture */
706
+ # define ARCHITECTURE_ID ""
707
+ # endif
708
+
709
+ # elif defined(__ADSPSHARC__)
710
+ # define ARCHITECTURE_ID "SHARC"
711
+
712
+ # elif defined(__ADSPBLACKFIN__)
713
+ # define ARCHITECTURE_ID "Blackfin"
714
+
715
+ #elif defined(__TASKING__)
716
+
717
+ # if defined(__CTC__) || defined(__CPTC__)
718
+ # define ARCHITECTURE_ID "TriCore"
719
+
720
+ # elif defined(__CMCS__)
721
+ # define ARCHITECTURE_ID "MCS"
722
+
723
+ # elif defined(__CARM__) || defined(__CPARM__)
724
+ # define ARCHITECTURE_ID "ARM"
725
+
726
+ # elif defined(__CARC__)
727
+ # define ARCHITECTURE_ID "ARC"
728
+
729
+ # elif defined(__C51__)
730
+ # define ARCHITECTURE_ID "8051"
731
+
732
+ # elif defined(__CPCP__)
733
+ # define ARCHITECTURE_ID "PCP"
734
+
735
+ # else
736
+ # define ARCHITECTURE_ID ""
737
+ # endif
738
+
739
+ #elif defined(__RENESAS__)
740
+ # if defined(__CCRX__)
741
+ # define ARCHITECTURE_ID "RX"
742
+
743
+ # elif defined(__CCRL__)
744
+ # define ARCHITECTURE_ID "RL78"
745
+
746
+ # elif defined(__CCRH__)
747
+ # define ARCHITECTURE_ID "RH850"
748
+
749
+ # else
750
+ # define ARCHITECTURE_ID ""
751
+ # endif
752
+
753
+ #else
754
+ # define ARCHITECTURE_ID
755
+ #endif
756
+
757
+ /* Convert integer to decimal digit literals. */
758
+ #define DEC(n) \
759
+ ('0' + (((n) / 10000000)%10)), \
760
+ ('0' + (((n) / 1000000)%10)), \
761
+ ('0' + (((n) / 100000)%10)), \
762
+ ('0' + (((n) / 10000)%10)), \
763
+ ('0' + (((n) / 1000)%10)), \
764
+ ('0' + (((n) / 100)%10)), \
765
+ ('0' + (((n) / 10)%10)), \
766
+ ('0' + ((n) % 10))
767
+
768
+ /* Convert integer to hex digit literals. */
769
+ #define HEX(n) \
770
+ ('0' + ((n)>>28 & 0xF)), \
771
+ ('0' + ((n)>>24 & 0xF)), \
772
+ ('0' + ((n)>>20 & 0xF)), \
773
+ ('0' + ((n)>>16 & 0xF)), \
774
+ ('0' + ((n)>>12 & 0xF)), \
775
+ ('0' + ((n)>>8 & 0xF)), \
776
+ ('0' + ((n)>>4 & 0xF)), \
777
+ ('0' + ((n) & 0xF))
778
+
779
+ /* Construct a string literal encoding the version number. */
780
+ #ifdef COMPILER_VERSION
781
+ char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
782
+
783
+ /* Construct a string literal encoding the version number components. */
784
+ #elif defined(COMPILER_VERSION_MAJOR)
785
+ char const info_version[] = {
786
+ 'I', 'N', 'F', 'O', ':',
787
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
788
+ COMPILER_VERSION_MAJOR,
789
+ # ifdef COMPILER_VERSION_MINOR
790
+ '.', COMPILER_VERSION_MINOR,
791
+ # ifdef COMPILER_VERSION_PATCH
792
+ '.', COMPILER_VERSION_PATCH,
793
+ # ifdef COMPILER_VERSION_TWEAK
794
+ '.', COMPILER_VERSION_TWEAK,
795
+ # endif
796
+ # endif
797
+ # endif
798
+ ']','\0'};
799
+ #endif
800
+
801
+ /* Construct a string literal encoding the internal version number. */
802
+ #ifdef COMPILER_VERSION_INTERNAL
803
+ char const info_version_internal[] = {
804
+ 'I', 'N', 'F', 'O', ':',
805
+ 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
806
+ 'i','n','t','e','r','n','a','l','[',
807
+ COMPILER_VERSION_INTERNAL,']','\0'};
808
+ #elif defined(COMPILER_VERSION_INTERNAL_STR)
809
+ char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
810
+ #endif
811
+
812
+ /* Construct a string literal encoding the version number components. */
813
+ #ifdef SIMULATE_VERSION_MAJOR
814
+ char const info_simulate_version[] = {
815
+ 'I', 'N', 'F', 'O', ':',
816
+ 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
817
+ SIMULATE_VERSION_MAJOR,
818
+ # ifdef SIMULATE_VERSION_MINOR
819
+ '.', SIMULATE_VERSION_MINOR,
820
+ # ifdef SIMULATE_VERSION_PATCH
821
+ '.', SIMULATE_VERSION_PATCH,
822
+ # ifdef SIMULATE_VERSION_TWEAK
823
+ '.', SIMULATE_VERSION_TWEAK,
824
+ # endif
825
+ # endif
826
+ # endif
827
+ ']','\0'};
828
+ #endif
829
+
830
+ /* Construct the string literal in pieces to prevent the source from
831
+ getting matched. Store it in a pointer rather than an array
832
+ because some compilers will just produce instructions to fill the
833
+ array rather than assigning a pointer to a static array. */
834
+ char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
835
+ char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
836
+
837
+
838
+
839
+ #define CXX_STD_98 199711L
840
+ #define CXX_STD_11 201103L
841
+ #define CXX_STD_14 201402L
842
+ #define CXX_STD_17 201703L
843
+ #define CXX_STD_20 202002L
844
+ #define CXX_STD_23 202302L
845
+
846
+ #if defined(__INTEL_COMPILER) && defined(_MSVC_LANG)
847
+ # if _MSVC_LANG > CXX_STD_17
848
+ # define CXX_STD _MSVC_LANG
849
+ # elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
850
+ # define CXX_STD CXX_STD_20
851
+ # elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17
852
+ # define CXX_STD CXX_STD_20
853
+ # elif _MSVC_LANG > CXX_STD_14
854
+ # define CXX_STD CXX_STD_17
855
+ # elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi)
856
+ # define CXX_STD CXX_STD_14
857
+ # elif defined(__INTEL_CXX11_MODE__)
858
+ # define CXX_STD CXX_STD_11
859
+ # else
860
+ # define CXX_STD CXX_STD_98
861
+ # endif
862
+ #elif defined(_MSC_VER) && defined(_MSVC_LANG)
863
+ # if _MSVC_LANG > __cplusplus
864
+ # define CXX_STD _MSVC_LANG
865
+ # else
866
+ # define CXX_STD __cplusplus
867
+ # endif
868
+ #elif defined(__NVCOMPILER)
869
+ # if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init)
870
+ # define CXX_STD CXX_STD_20
871
+ # else
872
+ # define CXX_STD __cplusplus
873
+ # endif
874
+ #elif defined(__INTEL_COMPILER) || defined(__PGI)
875
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes)
876
+ # define CXX_STD CXX_STD_17
877
+ # elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
878
+ # define CXX_STD CXX_STD_14
879
+ # else
880
+ # define CXX_STD __cplusplus
881
+ # endif
882
+ #elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__)
883
+ # if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi)
884
+ # define CXX_STD CXX_STD_14
885
+ # else
886
+ # define CXX_STD __cplusplus
887
+ # endif
888
+ #elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
889
+ # define CXX_STD CXX_STD_11
890
+ #else
891
+ # define CXX_STD __cplusplus
892
+ #endif
893
+
894
+ const char* info_language_standard_default = "INFO" ":" "standard_default["
895
+ #if CXX_STD > CXX_STD_23
896
+ "26"
897
+ #elif CXX_STD > CXX_STD_20
898
+ "23"
899
+ #elif CXX_STD > CXX_STD_17
900
+ "20"
901
+ #elif CXX_STD > CXX_STD_14
902
+ "17"
903
+ #elif CXX_STD > CXX_STD_11
904
+ "14"
905
+ #elif CXX_STD >= CXX_STD_11
906
+ "11"
907
+ #else
908
+ "98"
909
+ #endif
910
+ "]";
911
+
912
+ const char* info_language_extensions_default = "INFO" ":" "extensions_default["
913
+ #if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
914
+ defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \
915
+ !defined(__STRICT_ANSI__)
916
+ "ON"
917
+ #else
918
+ "OFF"
919
+ #endif
920
+ "]";
921
+
922
+ /*--------------------------------------------------------------------------*/
923
+
924
+ int main(int argc, char* argv[])
925
+ {
926
+ int require = 0;
927
+ require += info_compiler[argc];
928
+ require += info_platform[argc];
929
+ require += info_arch[argc];
930
+ #ifdef COMPILER_VERSION_MAJOR
931
+ require += info_version[argc];
932
+ #endif
933
+ #if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR)
934
+ require += info_version_internal[argc];
935
+ #endif
936
+ #ifdef SIMULATE_ID
937
+ require += info_simulate[argc];
938
+ #endif
939
+ #ifdef SIMULATE_VERSION_MAJOR
940
+ require += info_simulate_version[argc];
941
+ #endif
942
+ #if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
943
+ require += info_cray[argc];
944
+ #endif
945
+ require += info_language_standard_default[argc];
946
+ require += info_language_extensions_default[argc];
947
+ (void)argv;
948
+ return require;
949
+ }