pw_span: Introduce pw::span

- pw::span is identical to Pigweed's polyfilled std::span, but in a
  different namespace. Implicit converions between std::span and
  pw::span are supported inherently.

  pw::span and std::span are maintained as separate classes, with shared
  code in a .inc file. This is done instead of aliasing since C++17 does
  not support class template argument decuction with aliases. Also, it
  is simpler to have separate implementations to avoid circular
  dependencies while migrating code to pw::span.
- Add DEFINES to the pw_add_test() CMake function to support defining
  preprocessor macros for the pw_span test.
- Move '.inc' and '.inl' extensions from CPP_HEADER_EXTS to
  CPP_SOURCE_EXTS, since these should be treated like sources not
  headers (no include guards).

Bug: b/235237667
Change-Id: I4d76fb373cdaa4d3a5d72a0537bea492b5c06814
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/98160
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
11 files changed
tree: fc86f4153a1cde09315909fd2e5606df479a5d85
  1. build_overrides/
  2. docker/
  3. docs/
  4. pw_allocator/
  5. pw_analog/
  6. pw_android_toolchain/
  7. pw_arduino_build/
  8. pw_assert/
  9. pw_assert_basic/
  10. pw_assert_log/
  11. pw_assert_tokenized/
  12. pw_assert_zephyr/
  13. pw_base64/
  14. pw_bloat/
  15. pw_blob_store/
  16. pw_bluetooth/
  17. pw_bluetooth_hci/
  18. pw_boot/
  19. pw_boot_cortex_m/
  20. pw_build/
  21. pw_build_info/
  22. pw_build_mcuxpresso/
  23. pw_bytes/
  24. pw_checksum/
  25. pw_chrono/
  26. pw_chrono_embos/
  27. pw_chrono_freertos/
  28. pw_chrono_stl/
  29. pw_chrono_threadx/
  30. pw_chrono_zephyr/
  31. pw_cli/
  32. pw_console/
  33. pw_containers/
  34. pw_cpu_exception/
  35. pw_cpu_exception_cortex_m/
  36. pw_crypto/
  37. pw_docgen/
  38. pw_doctor/
  39. pw_env_setup/
  40. pw_file/
  41. pw_function/
  42. pw_fuzzer/
  43. pw_hdlc/
  44. pw_hex_dump/
  45. pw_i2c/
  46. pw_i2c_mcuxpresso/
  47. pw_interrupt/
  48. pw_interrupt_cortex_m/
  49. pw_interrupt_zephyr/
  50. pw_kvs/
  51. pw_libc/
  52. pw_log/
  53. pw_log_android/
  54. pw_log_basic/
  55. pw_log_null/
  56. pw_log_rpc/
  57. pw_log_string/
  58. pw_log_tokenized/
  59. pw_log_zephyr/
  60. pw_malloc/
  61. pw_malloc_freelist/
  62. pw_metric/
  63. pw_minimal_cpp_stdlib/
  64. pw_module/
  65. pw_multisink/
  66. pw_package/
  67. pw_persistent_ram/
  68. pw_polyfill/
  69. pw_preprocessor/
  70. pw_presubmit/
  71. pw_protobuf/
  72. pw_protobuf_compiler/
  73. pw_random/
  74. pw_result/
  75. pw_ring_buffer/
  76. pw_router/
  77. pw_rpc/
  78. pw_snapshot/
  79. pw_software_update/
  80. pw_span/
  81. pw_spi/
  82. pw_status/
  83. pw_stm32cube_build/
  84. pw_stream/
  85. pw_string/
  86. pw_symbolizer/
  87. pw_sync/
  88. pw_sync_baremetal/
  89. pw_sync_embos/
  90. pw_sync_freertos/
  91. pw_sync_stl/
  92. pw_sync_threadx/
  93. pw_sync_zephyr/
  94. pw_sys_io/
  95. pw_sys_io_arduino/
  96. pw_sys_io_baremetal_lm3s6965evb/
  97. pw_sys_io_baremetal_stm32f429/
  98. pw_sys_io_emcraft_sf2/
  99. pw_sys_io_mcuxpresso/
  100. pw_sys_io_stdio/
  101. pw_sys_io_stm32cube/
  102. pw_sys_io_zephyr/
  103. pw_system/
  104. pw_target_runner/
  105. pw_thread/
  106. pw_thread_embos/
  107. pw_thread_freertos/
  108. pw_thread_stl/
  109. pw_thread_threadx/
  110. pw_tls_client/
  111. pw_tls_client_boringssl/
  112. pw_tls_client_mbedtls/
  113. pw_tokenizer/
  114. pw_tool/
  115. pw_toolchain/
  116. pw_trace/
  117. pw_trace_tokenized/
  118. pw_transfer/
  119. pw_unit_test/
  120. pw_varint/
  121. pw_watch/
  122. pw_web_ui/
  123. pw_work_queue/
  124. targets/
  125. third_party/
  126. zephyr/
  127. .bazelignore
  128. .bazelrc
  129. .clang-format
  130. .clang-tidy
  131. .eslintrc.json
  132. .gitattributes
  133. .gitignore
  134. .gn
  135. .prettierrc.js
  136. .pylintrc
  137. activate.bat
  138. Android.bp
  139. AUTHORS
  140. bootstrap.bat
  141. bootstrap.sh
  142. BUILD.bazel
  143. BUILD.gn
  144. BUILDCONFIG.gn
  145. CMakeLists.txt
  146. Kconfig.zephyr
  147. LICENSE
  148. modules.gni
  149. OWNERS
  150. package.json
  151. PIGWEED_MODULES
  152. PW_PLUGINS
  153. README.md
  154. tsconfig.json
  155. WORKSPACE
  156. yarn.lock
README.md

Pigweed

Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.

For more information please see our website: https://pigweed.dev/

Links