pw_preprocessor: Use __VA_OPT__ when available

When available, use __VA_OPT__ to implement PW_EMPTY_ARGS() instead of
the current workaround. This dramatically simplifies PW_EMPTY_ARGS(),
resulting in:

- code that is easier to understand and debug,
- simpler error messages involving PW_EMPTY_ARGS(),
- support for any number of arguments (currently, PW_EMPTY_ARGS() fails
  to compile for >64 arguments),
- potentially faster compilation times, since PW_EMPTY_ARGS() is
  expanded many, many times in a build (10+ times per tokenized log).

Change-Id: I8ddd181c93b34216bdaf03490872a055f32b699e
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/187099
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
Reviewed-by: Taylor Cramer <cramertj@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
3 files changed
tree: 62d2319bdb8ce59d62e5e44cc487941ce26afe91
  1. .allstar/
  2. .vscode/
  3. build_overrides/
  4. docker/
  5. docs/
  6. kudzu/
  7. pw_alignment/
  8. pw_allocator/
  9. pw_analog/
  10. pw_android_toolchain/
  11. pw_arduino_build/
  12. pw_assert/
  13. pw_assert_basic/
  14. pw_assert_log/
  15. pw_assert_tokenized/
  16. pw_assert_zephyr/
  17. pw_async/
  18. pw_async2/
  19. pw_async2_basic/
  20. pw_async_basic/
  21. pw_base64/
  22. pw_bloat/
  23. pw_blob_store/
  24. pw_bluetooth/
  25. pw_bluetooth_hci/
  26. pw_bluetooth_profiles/
  27. pw_bluetooth_sapphire/
  28. pw_boot/
  29. pw_boot_cortex_m/
  30. pw_build/
  31. pw_build_info/
  32. pw_build_mcuxpresso/
  33. pw_bytes/
  34. pw_channel/
  35. pw_checksum/
  36. pw_chre/
  37. pw_chrono/
  38. pw_chrono_embos/
  39. pw_chrono_freertos/
  40. pw_chrono_rp2040/
  41. pw_chrono_stl/
  42. pw_chrono_threadx/
  43. pw_chrono_zephyr/
  44. pw_cli/
  45. pw_compilation_testing/
  46. pw_config_loader/
  47. pw_console/
  48. pw_containers/
  49. pw_cpu_exception/
  50. pw_cpu_exception_cortex_m/
  51. pw_crypto/
  52. pw_digital_io/
  53. pw_digital_io_mcuxpresso/
  54. pw_digital_io_rp2040/
  55. pw_docgen/
  56. pw_doctor/
  57. pw_emu/
  58. pw_env_setup/
  59. pw_env_setup_zephyr/
  60. pw_file/
  61. pw_format/
  62. pw_function/
  63. pw_fuzzer/
  64. pw_grpc/
  65. pw_hdlc/
  66. pw_hex_dump/
  67. pw_i2c/
  68. pw_i2c_linux/
  69. pw_i2c_mcuxpresso/
  70. pw_ide/
  71. pw_interrupt/
  72. pw_interrupt_cortex_m/
  73. pw_interrupt_xtensa/
  74. pw_interrupt_zephyr/
  75. pw_intrusive_ptr/
  76. pw_kvs/
  77. pw_libc/
  78. pw_libcxx/
  79. pw_log/
  80. pw_log_android/
  81. pw_log_basic/
  82. pw_log_null/
  83. pw_log_rpc/
  84. pw_log_string/
  85. pw_log_tokenized/
  86. pw_log_zephyr/
  87. pw_malloc/
  88. pw_malloc_freelist/
  89. pw_malloc_freertos/
  90. pw_metric/
  91. pw_minimal_cpp_stdlib/
  92. pw_module/
  93. pw_multibuf/
  94. pw_multisink/
  95. pw_package/
  96. pw_perf_test/
  97. pw_persistent_ram/
  98. pw_polyfill/
  99. pw_preprocessor/
  100. pw_presubmit/
  101. pw_protobuf/
  102. pw_protobuf_compiler/
  103. pw_random/
  104. pw_result/
  105. pw_ring_buffer/
  106. pw_router/
  107. pw_rpc/
  108. pw_rpc_transport/
  109. pw_rust/
  110. pw_snapshot/
  111. pw_software_update/
  112. pw_span/
  113. pw_spi/
  114. pw_spi_mcuxpresso/
  115. pw_spi_rp2040/
  116. pw_status/
  117. pw_stm32cube_build/
  118. pw_stream/
  119. pw_stream_shmem_mcuxpresso/
  120. pw_stream_uart_linux/
  121. pw_stream_uart_mcuxpresso/
  122. pw_string/
  123. pw_symbolizer/
  124. pw_sync/
  125. pw_sync_baremetal/
  126. pw_sync_embos/
  127. pw_sync_freertos/
  128. pw_sync_stl/
  129. pw_sync_threadx/
  130. pw_sync_zephyr/
  131. pw_sys_io/
  132. pw_sys_io_ambiq_sdk/
  133. pw_sys_io_arduino/
  134. pw_sys_io_baremetal_lm3s6965evb/
  135. pw_sys_io_baremetal_stm32f429/
  136. pw_sys_io_emcraft_sf2/
  137. pw_sys_io_mcuxpresso/
  138. pw_sys_io_rp2040/
  139. pw_sys_io_stdio/
  140. pw_sys_io_stm32cube/
  141. pw_sys_io_zephyr/
  142. pw_system/
  143. pw_target_runner/
  144. pw_thread/
  145. pw_thread_embos/
  146. pw_thread_freertos/
  147. pw_thread_stl/
  148. pw_thread_threadx/
  149. pw_thread_zephyr/
  150. pw_tls_client/
  151. pw_tls_client_boringssl/
  152. pw_tls_client_mbedtls/
  153. pw_tokenizer/
  154. pw_toolchain/
  155. pw_toolchain_bazel/
  156. pw_trace/
  157. pw_trace_tokenized/
  158. pw_transfer/
  159. pw_unit_test/
  160. pw_unit_test_zephyr/
  161. pw_varint/
  162. pw_watch/
  163. pw_web/
  164. pw_work_queue/
  165. seed/
  166. targets/
  167. third_party/
  168. ts/
  169. zephyr/
  170. .bazelignore
  171. .bazelrc
  172. .black.toml
  173. .clang-format
  174. .clang-tidy
  175. .eslintrc.cjs
  176. .git-blame-ignore-revs
  177. .gitattributes
  178. .gitignore
  179. .gn
  180. .mypy.ini
  181. .prettierignore
  182. .prettierrc.cjs
  183. .pw_ide.yaml
  184. .pylintrc
  185. activate.bat
  186. Android.bp
  187. AUTHORS
  188. bootstrap.bat
  189. bootstrap.sh
  190. BUILD.bazel
  191. BUILD.gn
  192. BUILDCONFIG.gn
  193. CMakeLists.txt
  194. jest.config.ts
  195. Kconfig.zephyr
  196. LICENSE
  197. modules.gni
  198. OWNERS
  199. package-lock.json
  200. package.json
  201. pigweed.json
  202. PIGWEED_MODULES
  203. README.md
  204. rollup.config.js
  205. tsconfig.json
  206. WORKSPACE
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