From 72acf0d101fa95110ed2af01c91756b82dcf7aec Mon Sep 17 00:00:00 2001 From: Tian Liao Date: Tue, 13 Oct 2026 12:28:25 +0800 Subject: [PATCH 1/2] Rename msft to ngcpp --- .github/workflows/bvt-appleclang-arm64e.yml | 2 +- .github/workflows/bvt-appleclang.yml | 2 +- .github/workflows/bvt-clang.yml | 2 +- .github/workflows/bvt-gcc.yml | 2 +- .github/workflows/bvt-msvc.yml | 2 +- .github/workflows/bvt-nvhpc.yml | 2 +- .github/workflows/bvt-oneapi.yml | 2 +- .github/workflows/pipeline-release.yml | 2 +- CMakeLists.txt | 50 +++++++++---------- README.md | 10 ++-- benchmarks/CMakeLists.txt | 12 ++--- benchmarks/meson.build | 4 +- cmake/msft_proxy5Config.cmake.in | 5 -- cmake/msft_proxy5ModuleTargets.cmake | 34 ------------- cmake/ngcpp_proxy5Config.cmake.in | 5 ++ cmake/ngcpp_proxy5ModuleTargets.cmake | 34 +++++++++++++ docs/CMakeLists.txt | 4 +- docs/faq.md | 2 +- docs/meson.build | 2 +- docs/modules_support.md | 34 ++++++------- docs/spec/.pages | 2 +- docs/spec/README.md | 2 +- docs/spec/msft_lib_proxy.md | 40 --------------- docs/spec/ngcpp_lib_proxy.md | 41 +++++++++++++++ include/proxy/proxy.h | 6 +-- include/proxy/proxy_fmt.h | 6 +-- include/proxy/proxy_macros.h | 6 +-- include/proxy/v5/detail/compatibility_check.h | 6 +-- include/proxy/v5/detail/core.h | 6 +-- include/proxy/v5/detail/dispatch.h | 6 +-- include/proxy/v5/detail/facade_creation.h | 6 +-- include/proxy/v5/detail/metadata_policy.h | 6 +-- include/proxy/v5/detail/proxy_creation.h | 6 +-- include/proxy/v5/detail/skills.h | 6 +-- include/proxy/v5/proxy.h | 6 +-- include/proxy/v5/proxy_fmt.h | 10 ++-- include/proxy/v5/proxy_macros.h | 42 +++++++++++++--- meson.build | 6 +-- tests/CMakeLists.txt | 14 +++--- tests/freestanding/CMakeLists.txt | 18 +++---- tests/freestanding/meson.build | 4 +- tests/meson.build | 4 +- tests/modules/CMakeLists.txt | 6 +-- tests/utils.h | 6 +-- 44 files changed, 251 insertions(+), 222 deletions(-) delete mode 100644 cmake/msft_proxy5Config.cmake.in delete mode 100644 cmake/msft_proxy5ModuleTargets.cmake create mode 100644 cmake/ngcpp_proxy5Config.cmake.in create mode 100644 cmake/ngcpp_proxy5ModuleTargets.cmake delete mode 100644 docs/spec/msft_lib_proxy.md create mode 100644 docs/spec/ngcpp_lib_proxy.md diff --git a/.github/workflows/bvt-appleclang-arm64e.yml b/.github/workflows/bvt-appleclang-arm64e.yml index bb611a79..58e3346d 100644 --- a/.github/workflows/bvt-appleclang-arm64e.yml +++ b/.github/workflows/bvt-appleclang-arm64e.yml @@ -30,7 +30,7 @@ jobs: ctest --preset freestanding -j - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-appleclang.yml b/.github/workflows/bvt-appleclang.yml index 8b362d4a..48217116 100644 --- a/.github/workflows/bvt-appleclang.yml +++ b/.github/workflows/bvt-appleclang.yml @@ -49,7 +49,7 @@ jobs: run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/... - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-clang.yml b/.github/workflows/bvt-clang.yml index ce367d75..df5b796e 100644 --- a/.github/workflows/bvt-clang.yml +++ b/.github/workflows/bvt-clang.yml @@ -64,7 +64,7 @@ jobs: run: bazel test --config=freestanding --lockfile_mode=error //tests:proxy_freestanding_tests - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-gcc.yml b/.github/workflows/bvt-gcc.yml index 6b76bbba..881df318 100644 --- a/.github/workflows/bvt-gcc.yml +++ b/.github/workflows/bvt-gcc.yml @@ -62,7 +62,7 @@ jobs: run: bazel test --config=freestanding --lockfile_mode=error //tests:proxy_freestanding_tests - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-msvc.yml b/.github/workflows/bvt-msvc.yml index 6bc0bd67..766a955e 100644 --- a/.github/workflows/bvt-msvc.yml +++ b/.github/workflows/bvt-msvc.yml @@ -38,7 +38,7 @@ jobs: run: bazel test --lockfile_mode=error //tests:proxy_tests //benchmarks:proxy_benchmarks //docs/... - name: Run benchmarks - run: build/cmake/benchmarks/Release/msft_proxy_benchmarks.exe --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/Release/ngcpp_proxy_benchmarks.exe --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-nvhpc.yml b/.github/workflows/bvt-nvhpc.yml index 0fd38aed..6ff7203f 100644 --- a/.github/workflows/bvt-nvhpc.yml +++ b/.github/workflows/bvt-nvhpc.yml @@ -51,7 +51,7 @@ jobs: meson test -C build/meson --benchmark --test-args=--benchmark_list_tests=true - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/bvt-oneapi.yml b/.github/workflows/bvt-oneapi.yml index acebd860..9a3a31b6 100644 --- a/.github/workflows/bvt-oneapi.yml +++ b/.github/workflows/bvt-oneapi.yml @@ -72,7 +72,7 @@ jobs: run: bazel test --config=freestanding --lockfile_mode=error --cxxopt=-Wno-c++23-extensions --test_env=LD_LIBRARY_PATH //tests:proxy_freestanding_tests - name: Run benchmarks - run: build/cmake/benchmarks/msft_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json + run: build/cmake/benchmarks/ngcpp_proxy_benchmarks --benchmark_min_warmup_time=0.1 --benchmark_min_time=0.1s --benchmark_repetitions=30 --benchmark_enable_random_interleaving=true --benchmark_report_aggregates_only=true --benchmark_format=json > build/cmake/drop/benchmarking-results.json - name: Archive benchmarking results uses: actions/upload-artifact@v7 diff --git a/.github/workflows/pipeline-release.yml b/.github/workflows/pipeline-release.yml index cdd96e29..f4852757 100644 --- a/.github/workflows/pipeline-release.yml +++ b/.github/workflows/pipeline-release.yml @@ -14,7 +14,7 @@ jobs: - name: Pack source id: run-pack run: | - version=$(grep -oP 'msft_proxy\d+\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) + version=$(grep -oP 'ngcpp_proxy\d+\s+VERSION\s+\K[0-9]+\.[0-9]+\.[0-9]+' CMakeLists.txt) git tag "$version" git push origin "$version" git ls-files 'include/**.h' 'include/**.ixx' | xargs tar -czf "proxy-$version.tgz" diff --git a/CMakeLists.txt b/CMakeLists.txt index 78ef1cc5..0140fbd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.28) -project(msft_proxy5 VERSION 5.0.0 LANGUAGES CXX) -add_library(msft_proxy5 INTERFACE) -set_target_properties(msft_proxy5 PROPERTIES EXPORT_NAME proxy) -add_library(msft_proxy5::proxy ALIAS msft_proxy5) +project(ngcpp_proxy5 VERSION 5.0.0 LANGUAGES CXX) +add_library(ngcpp_proxy5 INTERFACE) +set_target_properties(ngcpp_proxy5 PROPERTIES EXPORT_NAME proxy) +add_library(ngcpp_proxy5::proxy ALIAS ngcpp_proxy5) # Do not enable building tests if proxy is consumed as # subdirectory (e.g. by CMake FetchContent_Declare). @@ -43,7 +43,7 @@ endif() file(GLOB_RECURSE proxy_public_headers CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/include/proxy/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/proxy/*.ixx") -target_sources(msft_proxy5 +target_sources(ngcpp_proxy5 INTERFACE FILE_SET public_headers TYPE HEADERS @@ -51,9 +51,9 @@ target_sources(msft_proxy5 FILES ${proxy_public_headers} ) -target_compile_features(msft_proxy5 INTERFACE cxx_std_20) +target_compile_features(ngcpp_proxy5 INTERFACE cxx_std_20) target_include_directories( - msft_proxy5 + ngcpp_proxy5 INTERFACE $ $ @@ -61,13 +61,13 @@ target_include_directories( # Do not set the module target if proxy is consumed as a subdirectory. if(PROJECT_IS_TOP_LEVEL) - set(msft_proxy5_INCLUDE_DIR include) + set(ngcpp_proxy5_INCLUDE_DIR include) if(PROXY_BUILD_MODULES) - include(cmake/msft_proxy5ModuleTargets.cmake) + include(cmake/ngcpp_proxy5ModuleTargets.cmake) endif() else() # Propagate the variable to the parent project - set(msft_proxy5_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) + set(ngcpp_proxy5_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE) endif() # install and export the project. project name - proxy @@ -75,42 +75,42 @@ endif() include(GNUInstallDirs) install( - TARGETS msft_proxy5 - EXPORT msft_proxy5Targets + TARGETS ngcpp_proxy5 + EXPORT ngcpp_proxy5Targets FILE_SET public_headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install( - EXPORT msft_proxy5Targets - NAMESPACE msft_proxy5:: - DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 + EXPORT ngcpp_proxy5Targets + NAMESPACE ngcpp_proxy5:: + DESTINATION ${CMAKE_INSTALL_DATADIR}/ngcpp_proxy5 ) export( - TARGETS msft_proxy5 - NAMESPACE msft_proxy5:: - FILE msft_proxy5Targets.cmake + TARGETS ngcpp_proxy5 + NAMESPACE ngcpp_proxy5:: + FILE ngcpp_proxy5Targets.cmake ) include(CMakePackageConfigHelpers) configure_package_config_file( - cmake/msft_proxy5Config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5Config.cmake - INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 + cmake/ngcpp_proxy5Config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake/ngcpp_proxy5Config.cmake + INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/ngcpp_proxy5 PATH_VARS CMAKE_INSTALL_INCLUDEDIR ) include(CMakePackageConfigHelpers) write_basic_package_version_file( - cmake/msft_proxy5ConfigVersion.cmake + cmake/ngcpp_proxy5ConfigVersion.cmake COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT ) install( FILES - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cmake/msft_proxy5ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_DATADIR}/msft_proxy5 + ${CMAKE_CURRENT_BINARY_DIR}/cmake/ngcpp_proxy5Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/cmake/ngcpp_proxy5ConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_DATADIR}/ngcpp_proxy5 ) # build tests if BUILD_TESTING is ON diff --git a/README.md b/README.md index 5efa4217..345c6faa 100644 --- a/README.md +++ b/README.md @@ -245,12 +245,12 @@ Fetch via [CPM](https://github.com/cpm-cmake/CPM.cmake) (a thin wrapper over CMa ```cmake CPMAddPackage( - NAME msft_proxy5 + NAME ngcpp_proxy5 GIT_TAG 5.0.0 GIT_REPOSITORY https://github.com/ngcpp/proxy.git ) -target_link_libraries(main PRIVATE msft_proxy5::proxy) +target_link_libraries(main PRIVATE ngcpp_proxy5::proxy) ``` Or, if you already have a local clone, use `add_subdirectory(path/to/proxy)` instead of `CPMAddPackage`. @@ -265,14 +265,14 @@ url = https://github.com/ngcpp/proxy.git revision = 5.0.0 [provide] -dependency_names = msft_proxy5 +dependency_names = ngcpp_proxy5 ``` Then in your `meson.build`: ```meson -msft_proxy5_dep = dependency('msft_proxy5') -executable('main', 'main.cpp', dependencies: msft_proxy5_dep) +ngcpp_proxy5_dep = dependency('ngcpp_proxy5') +executable('main', 'main.cpp', dependencies: ngcpp_proxy5_dep) ``` ### Bazel diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 74dccea4..dee80548 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,4 +1,4 @@ -project(msft_proxy_benchmarks) +project(ngcpp_proxy_benchmarks) FetchContent_Declare( benchmark @@ -20,17 +20,17 @@ set( FetchContent_MakeAvailable(benchmark) add_executable( - msft_proxy_benchmarks + ngcpp_proxy_benchmarks proxy_creation_benchmark.cpp proxy_operation_benchmark_context.cpp proxy_operation_benchmark.cpp ) -target_include_directories(msft_proxy_benchmarks PRIVATE .) +target_include_directories(ngcpp_proxy_benchmarks PRIVATE .) target_link_libraries( - msft_proxy_benchmarks - PRIVATE msft_proxy5::proxy benchmark::benchmark benchmark::benchmark_main + ngcpp_proxy_benchmarks + PRIVATE ngcpp_proxy5::proxy benchmark::benchmark benchmark::benchmark_main ) target_compile_options( - msft_proxy_benchmarks + ngcpp_proxy_benchmarks PRIVATE ${PROXY_BUILD_FLAGS} $<$:/bigobj> ) diff --git a/benchmarks/meson.build b/benchmarks/meson.build index c5ef29a7..9b97f250 100644 --- a/benchmarks/meson.build +++ b/benchmarks/meson.build @@ -1,14 +1,14 @@ benchmark( 'ProxyBenchmarks', executable( - 'msft_proxy_benchmarks', + 'ngcpp_proxy_benchmarks', files( 'proxy_creation_benchmark.cpp', 'proxy_operation_benchmark.cpp', 'proxy_operation_benchmark_context.cpp', ), implicit_include_directories: false, - dependencies: [msft_proxy5_dep, benchmark_dep], + dependencies: [ngcpp_proxy5_dep, benchmark_dep], cpp_args: cxx.get_argument_syntax() == 'msvc' ? ['/bigobj'] : [], ), ) diff --git a/cmake/msft_proxy5Config.cmake.in b/cmake/msft_proxy5Config.cmake.in deleted file mode 100644 index c6daff7d..00000000 --- a/cmake/msft_proxy5Config.cmake.in +++ /dev/null @@ -1,5 +0,0 @@ -@PACKAGE_INIT@ - -include("${CMAKE_CURRENT_LIST_DIR}/msft_proxy5Targets.cmake") - -set(msft_proxy5_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/cmake/msft_proxy5ModuleTargets.cmake b/cmake/msft_proxy5ModuleTargets.cmake deleted file mode 100644 index fdc4292f..00000000 --- a/cmake/msft_proxy5ModuleTargets.cmake +++ /dev/null @@ -1,34 +0,0 @@ -if(NOT DEFINED msft_proxy5_INCLUDE_DIR) - message( - FATAL_ERROR - "`msft_proxy5_INCLUDE_DIR` must be defined to use this script." - ) -endif() - -message( - STATUS - "Declaring `msft_proxy5::proxy_module` target for include path `${msft_proxy5_INCLUDE_DIR}`" -) - -add_library(msft_proxy5_module) -set_target_properties( - msft_proxy5_module - PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE -) - -add_library(msft_proxy5::proxy_module ALIAS msft_proxy5_module) -target_sources( - msft_proxy5_module - PUBLIC - FILE_SET CXX_MODULES - BASE_DIRS ${msft_proxy5_INCLUDE_DIR} - FILES ${msft_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx -) -target_compile_features(msft_proxy5_module PUBLIC cxx_std_20) -target_compile_options( - msft_proxy5_module - PRIVATE - $<$:/utf-8> - $<$:-Wno-c++2b-extensions> -) -target_link_libraries(msft_proxy5_module PUBLIC msft_proxy5::proxy) diff --git a/cmake/ngcpp_proxy5Config.cmake.in b/cmake/ngcpp_proxy5Config.cmake.in new file mode 100644 index 00000000..b44e3732 --- /dev/null +++ b/cmake/ngcpp_proxy5Config.cmake.in @@ -0,0 +1,5 @@ +@PACKAGE_INIT@ + +include("${CMAKE_CURRENT_LIST_DIR}/ngcpp_proxy5Targets.cmake") + +set(ngcpp_proxy5_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") diff --git a/cmake/ngcpp_proxy5ModuleTargets.cmake b/cmake/ngcpp_proxy5ModuleTargets.cmake new file mode 100644 index 00000000..6bf415df --- /dev/null +++ b/cmake/ngcpp_proxy5ModuleTargets.cmake @@ -0,0 +1,34 @@ +if(NOT DEFINED ngcpp_proxy5_INCLUDE_DIR) + message( + FATAL_ERROR + "`ngcpp_proxy5_INCLUDE_DIR` must be defined to use this script." + ) +endif() + +message( + STATUS + "Declaring `ngcpp_proxy5::proxy_module` target for include path `${ngcpp_proxy5_INCLUDE_DIR}`" +) + +add_library(ngcpp_proxy5_module) +set_target_properties( + ngcpp_proxy5_module + PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE +) + +add_library(ngcpp_proxy5::proxy_module ALIAS ngcpp_proxy5_module) +target_sources( + ngcpp_proxy5_module + PUBLIC + FILE_SET CXX_MODULES + BASE_DIRS ${ngcpp_proxy5_INCLUDE_DIR} + FILES ${ngcpp_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx +) +target_compile_features(ngcpp_proxy5_module PUBLIC cxx_std_20) +target_compile_options( + ngcpp_proxy5_module + PRIVATE + $<$:/utf-8> + $<$:-Wno-c++2b-extensions> +) +target_link_libraries(ngcpp_proxy5_module PUBLIC ngcpp_proxy5::proxy) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index d4e622ee..3cb7f0f5 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,4 +1,4 @@ -project(msft_proxy_docs) +project(ngcpp_proxy_docs) find_package(Python3 REQUIRED COMPONENTS Interpreter) @@ -60,7 +60,7 @@ foreach(i RANGE 0 ${_last}) add_executable(example_${_suffix} "${_cpp}") target_link_libraries( example_${_suffix} - PRIVATE msft_proxy5::proxy ${_dep_names} + PRIVATE ngcpp_proxy5::proxy ${_dep_names} ) target_compile_options(example_${_suffix} PRIVATE ${PROXY_BUILD_FLAGS}) add_test(NAME example_${_suffix} COMMAND example_${_suffix}) diff --git a/docs/faq.md b/docs/faq.md index a32117fe..2f8f7a4b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -64,7 +64,7 @@ At the beginning, we explored the feasibility of designing a general-purpose pol ### Why does "Proxy" define several macros instead of modern C++ facilities? -"Proxy" defines 6 macros: [`__msft_lib_proxy`](spec/msft_lib_proxy.md), [`PRO_DEF_MEM_DISPATCH`](spec/PRO_DEF_MEM_DISPATCH.md), [`PRO_DEF_FREE_DISPATCH`](spec/PRO_DEF_FREE_DISPATCH.md), [`PRO_DEF_FREE_AS_MEM_DISPATCH`](spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md), [`PRO_ENABLE_MEMBER`](spec/PRO_ENABLE_MEMBER.md), and [`PRO_ENABLE_FREE`](spec/PRO_ENABLE_FREE.md). [`__msft_lib_proxy`](spec/msft_lib_proxy.md) is the feature test macro, following the existing practice in the C++20 standard. The other 5 macros are fundamental facilities for function call expressions. `PRO_DEF_MEM_DISPATCH`, `PRO_DEF_FREE_DISPATCH`, and `PRO_DEF_FREE_AS_MEM_DISPATCH` define a custom [`dispatch`](spec/ProxyDispatch.md) type, while `PRO_ENABLE_MEMBER` and `PRO_ENABLE_FREE` define the dispatch and [access](spec/ProxyAccess.md) types of a given name. These macros cannot be replaced by modern C++ facilities because there is no existing language feature prior to C++26 that allows generating a function with an arbitrary name. Since [modules](https://en.cppreference.com/w/cpp/language/modules) cannot export macros, a translation unit that imports the module `proxy.v5` includes `proxy/proxy_macros.h` to use them (see [Modules Support](modules_support.md)). +"Proxy" defines 6 macros: [`__ngcpp_lib_proxy`](spec/ngcpp_lib_proxy.md), [`PRO_DEF_MEM_DISPATCH`](spec/PRO_DEF_MEM_DISPATCH.md), [`PRO_DEF_FREE_DISPATCH`](spec/PRO_DEF_FREE_DISPATCH.md), [`PRO_DEF_FREE_AS_MEM_DISPATCH`](spec/PRO_DEF_FREE_AS_MEM_DISPATCH.md), [`PRO_ENABLE_MEMBER`](spec/PRO_ENABLE_MEMBER.md), and [`PRO_ENABLE_FREE`](spec/PRO_ENABLE_FREE.md). [`__ngcpp_lib_proxy`](spec/ngcpp_lib_proxy.md) is the feature test macro, following the existing practice in the C++20 standard. The other 5 macros are fundamental facilities for function call expressions. `PRO_DEF_MEM_DISPATCH`, `PRO_DEF_FREE_DISPATCH`, and `PRO_DEF_FREE_AS_MEM_DISPATCH` define a custom [`dispatch`](spec/ProxyDispatch.md) type, while `PRO_ENABLE_MEMBER` and `PRO_ENABLE_FREE` define the dispatch and [access](spec/ProxyAccess.md) types of a given name. These macros cannot be replaced by modern C++ facilities because there is no existing language feature prior to C++26 that allows generating a function with an arbitrary name. Since [modules](https://en.cppreference.com/w/cpp/language/modules) cannot export macros, a translation unit that imports the module `proxy.v5` includes `proxy/proxy_macros.h` to use them (see [Modules Support](modules_support.md)). ### What is the standardization progress of this library? diff --git a/docs/meson.build b/docs/meson.build index f1f7a5cc..1ba70e89 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -31,7 +31,7 @@ foreach line : _gen.stdout().split('\n') ), extra_files: md, implicit_include_directories: false, - dependencies: [msft_proxy5_dep] + extra_deps, + dependencies: [ngcpp_proxy5_dep] + extra_deps, build_by_default: false, ) examples += _ex diff --git a/docs/modules_support.md b/docs/modules_support.md index 624585ee..3115396b 100644 --- a/docs/modules_support.md +++ b/docs/modules_support.md @@ -7,43 +7,43 @@ The "Proxy" library ships with `.ixx` files starting with version **4.0.0**. Com As of 2025-05-11, CMake lacks support for forward compatibility when consuming C++ modules, which causes consumers with newer C++ standard to be unable to use modules with older standard. Until this is implemented by CMake, a CMake target containing the module can be manually declared using the following CMake script: ```cmake -find_package(msft_proxy5 REQUIRED) +find_package(ngcpp_proxy5 REQUIRED) -if(NOT DEFINED msft_proxy5_INCLUDE_DIR) # (1) - if(NOT DEFINED msft_proxy5_SOURCE_DIR) - message(FATAL_ERROR "`msft_proxy5_INCLUDE_DIR` or `msft_proxy5_SOURCE_DIR` must be defined to use this script.") +if(NOT DEFINED ngcpp_proxy5_INCLUDE_DIR) # (1) + if(NOT DEFINED ngcpp_proxy5_SOURCE_DIR) + message(FATAL_ERROR "`ngcpp_proxy5_INCLUDE_DIR` or `ngcpp_proxy5_SOURCE_DIR` must be defined to use this script.") endif() - set(msft_proxy5_INCLUDE_DIR ${msft_proxy5_SOURCE_DIR}/include) + set(ngcpp_proxy5_INCLUDE_DIR ${ngcpp_proxy5_SOURCE_DIR}/include) endif() -message(STATUS "Declaring `msft_proxy5::proxy_module` target for include path `${msft_proxy5_INCLUDE_DIR}`") +message(STATUS "Declaring `ngcpp_proxy5::proxy_module` target for include path `${ngcpp_proxy5_INCLUDE_DIR}`") -add_library(msft_proxy5_module) +add_library(ngcpp_proxy5_module) set_target_properties( - msft_proxy5_module + ngcpp_proxy5_module PROPERTIES SYSTEM TRUE EXCLUDE_FROM_ALL TRUE ) -add_library(msft_proxy5::proxy_module ALIAS msft_proxy5_module) -target_sources(msft_proxy5_module PUBLIC +add_library(ngcpp_proxy5::proxy_module ALIAS ngcpp_proxy5_module) +target_sources(ngcpp_proxy5_module PUBLIC FILE_SET CXX_MODULES - BASE_DIRS ${msft_proxy5_INCLUDE_DIR} + BASE_DIRS ${ngcpp_proxy5_INCLUDE_DIR} FILES - ${msft_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx + ${ngcpp_proxy5_INCLUDE_DIR}/proxy/v5/proxy.ixx ) -target_compile_features(msft_proxy5_module PUBLIC cxx_std_20) # (2) -target_link_libraries(msft_proxy5_module PUBLIC msft_proxy5::proxy) +target_compile_features(ngcpp_proxy5_module PUBLIC cxx_std_20) # (2) +target_link_libraries(ngcpp_proxy5_module PUBLIC ngcpp_proxy5::proxy) ``` -- (1) `msft_proxy5_INCLUDE_DIR` is automatically declared after `find_package(msft_proxy5)`. CPM uses a slightly different convention where `msft_proxy5_SOURCE_DIR` is declared after `CPMAddPackage`. -- (2) The C++ standard version for `msft_proxy5_module` target should be the same or higher than the consumer CMake target. For example if your project is using C++23 mode, this line should be changed to `cxx_std_23` or `cxx_std_26` / newer standards. +- (1) `ngcpp_proxy5_INCLUDE_DIR` is automatically declared after `find_package(ngcpp_proxy5)`. CPM uses a slightly different convention where `ngcpp_proxy5_SOURCE_DIR` is declared after `CPMAddPackage`. +- (2) The C++ standard version for `ngcpp_proxy5_module` target should be the same or higher than the consumer CMake target. For example if your project is using C++23 mode, this line should be changed to `cxx_std_23` or `cxx_std_26` / newer standards. It can then be consumed like this: ```cmake -target_link_libraries(main PRIVATE msft_proxy5::proxy_module) +target_link_libraries(main PRIVATE ngcpp_proxy5::proxy_module) ``` ## Example diff --git a/docs/spec/.pages b/docs/spec/.pages index 4e336cee..5974419f 100644 --- a/docs/spec/.pages +++ b/docs/spec/.pages @@ -47,7 +47,7 @@ nav: - proxy_invoke: proxy_invoke.md - proxy_reflect: proxy_reflect.md - Macros: - - __msft_lib_proxy: msft_lib_proxy.md + - __ngcpp_lib_proxy: ngcpp_lib_proxy.md - PRO_DEF_FREE_AS_MEM_DISPATCH: PRO_DEF_FREE_AS_MEM_DISPATCH.md - PRO_DEF_FREE_DISPATCH: PRO_DEF_FREE_DISPATCH.md - PRO_DEF_MEM_DISPATCH: PRO_DEF_MEM_DISPATCH.md diff --git a/docs/spec/README.md b/docs/spec/README.md index 77dd150c..a0502596 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -75,7 +75,7 @@ Also included in `proxy.h`. | Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| [`__msft_lib_proxy`](msft_lib_proxy.md) | Feature test macro | +| [`__ngcpp_lib_proxy`](ngcpp_lib_proxy.md) | Feature test macro | | [`PRO_DEF_FREE_AS_MEM_DISPATCH` ](PRO_DEF_FREE_AS_MEM_DISPATCH.md) | Defines a dispatch type for free function call expressions with accessibility via a member function | | [`PRO_DEF_FREE_DISPATCH`](PRO_DEF_FREE_DISPATCH.md) | Defines a dispatch type for free function call expressions with accessibility | | [`PRO_DEF_MEM_DISPATCH`](PRO_DEF_MEM_DISPATCH.md) | Defines a dispatch type for member function call expressions with accessibility | diff --git a/docs/spec/msft_lib_proxy.md b/docs/spec/msft_lib_proxy.md deleted file mode 100644 index 01420c4c..00000000 --- a/docs/spec/msft_lib_proxy.md +++ /dev/null @@ -1,40 +0,0 @@ -# Feature test macro `__msft_lib_proxy` - -> Header: `proxy_macros.h` and `proxy.h` - -```cpp -#define __msft_lib_proxy /* see below */ -``` - -Starting with 3.0.0, Proxy ships a feature-test macro that encodes the library version. When headers from different major versions of the Proxy library can appear in the same translation unit (for example, Proxy 4 and Proxy 5), use the major-qualified form `__msft_lib_proxy` (e.g., `__msft_lib_proxy5`). - -| Version | Value of `__msft_lib_proxy` | -| ------- | --------------------------- | -| 4.1.0 | `202606L` | -| 4.0.2 | `202603L` | -| 4.0.1 | `202510L` | -| 4.0.0 | `202508L` | -| 3.4.0 | `202505L` | -| 3.3.0 | `202503L` | -| 3.2.1 | `202502L` | -| 3.2.0 | `202501L` | -| 3.1.0 | `202410L` | -| 3.0.0 | `202408L` | - -## Example - -```cpp -#include - -#include - -int main() { -#if __msft_lib_proxy >= 202508L - puts("Compiled with library Proxy 4.0.0 or above."); -#elif __msft_lib_proxy >= 202408L - puts("Compiled with library Proxy 3.x."); -#else - puts("Cannot determine the version of library Proxy."); -#endif -} -``` diff --git a/docs/spec/ngcpp_lib_proxy.md b/docs/spec/ngcpp_lib_proxy.md new file mode 100644 index 00000000..68d21e23 --- /dev/null +++ b/docs/spec/ngcpp_lib_proxy.md @@ -0,0 +1,41 @@ +# Feature test macro `__ngcpp_lib_proxy` + +> Header: `proxy_macros.h` and `proxy.h` + +```cpp +#define __ngcpp_lib_proxy /* see below */ +``` + +Starting with 3.0.0, Proxy ships a feature-test macro that encodes the library version. Releases before Proxy 5 defined this macro as `__msft_lib_proxy`. Starting with Proxy 5, it is named `__ngcpp_lib_proxy`, and the major-qualified form `__ngcpp_lib_proxy` (for example, `__ngcpp_lib_proxy5`) is also available when headers from different major versions can appear in the same translation unit. + +| Version | Feature-test macro | Value | +| ------- | -------------------- | --------- | +| 5.0.0 | `__ngcpp_lib_proxy` | `202606L` | +| 4.1.0 | `__msft_lib_proxy` | `202606L` | +| 4.0.2 | `__msft_lib_proxy` | `202603L` | +| 4.0.1 | `__msft_lib_proxy` | `202510L` | +| 4.0.0 | `__msft_lib_proxy` | `202508L` | +| 3.4.0 | `__msft_lib_proxy` | `202505L` | +| 3.3.0 | `__msft_lib_proxy` | `202503L` | +| 3.2.1 | `__msft_lib_proxy` | `202502L` | +| 3.2.0 | `__msft_lib_proxy` | `202501L` | +| 3.1.0 | `__msft_lib_proxy` | `202410L` | +| 3.0.0 | `__msft_lib_proxy` | `202408L` | + +`__msft_lib_proxy` and its major-qualified form `__msft_lib_proxy5` are retained as deprecated aliases for backward compatibility. Supporting compilers issue a deprecation warning when either alias is used. + +## Example + +```cpp +#include + +#include + +int main() { +#if __ngcpp_lib_proxy >= 202606L + puts("Compiled with library Proxy 5.0.0 or above."); +#else + puts("Compiled with an unsupported version or a version below Proxy 5.0.0."); +#endif +} +``` diff --git a/include/proxy/proxy.h b/include/proxy/proxy.h index ed1e4a33..6d77be28 100644 --- a/include/proxy/proxy.h +++ b/include/proxy/proxy.h @@ -2,9 +2,9 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_PROXY_H_ -#define MSFT_PROXY_PROXY_H_ +#ifndef NGCPP_PROXY_PROXY_H_ +#define NGCPP_PROXY_PROXY_H_ #include "v5/proxy.h" // IWYU pragma: export -#endif // MSFT_PROXY_PROXY_H_ +#endif // NGCPP_PROXY_PROXY_H_ diff --git a/include/proxy/proxy_fmt.h b/include/proxy/proxy_fmt.h index 2a56d3fa..d7486898 100644 --- a/include/proxy/proxy_fmt.h +++ b/include/proxy/proxy_fmt.h @@ -2,9 +2,9 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_PROXY_FMT_H_ -#define MSFT_PROXY_PROXY_FMT_H_ +#ifndef NGCPP_PROXY_PROXY_FMT_H_ +#define NGCPP_PROXY_PROXY_FMT_H_ #include "v5/proxy_fmt.h" // IWYU pragma: export -#endif // MSFT_PROXY_PROXY_FMT_H_ +#endif // NGCPP_PROXY_PROXY_FMT_H_ diff --git a/include/proxy/proxy_macros.h b/include/proxy/proxy_macros.h index 1c4c2bf0..04ca0f82 100644 --- a/include/proxy/proxy_macros.h +++ b/include/proxy/proxy_macros.h @@ -2,9 +2,9 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_PROXY_MACROS_H_ -#define MSFT_PROXY_PROXY_MACROS_H_ +#ifndef NGCPP_PROXY_PROXY_MACROS_H_ +#define NGCPP_PROXY_PROXY_MACROS_H_ #include "v5/proxy_macros.h" // IWYU pragma: export -#endif // MSFT_PROXY_PROXY_MACROS_H_ +#endif // NGCPP_PROXY_PROXY_MACROS_H_ diff --git a/include/proxy/v5/detail/compatibility_check.h b/include/proxy/v5/detail/compatibility_check.h index ea594691..72b67498 100644 --- a/include/proxy/v5/detail/compatibility_check.h +++ b/include/proxy/v5/detail/compatibility_check.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ -#define MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ +#define NGCPP_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ #if (defined(_MSVC_LANG) ? _MSVC_LANG : __cplusplus) < 202002L #error "Proxy requires C++20 or later." @@ -33,4 +33,4 @@ static_assert(sizeof(derived) == sizeof(char), // !__has_include()) #endif // __has_feature -#endif // MSFT_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ +#endif // NGCPP_PROXY_V5_DETAIL_COMPATIBILITY_CHECK_H_ diff --git a/include/proxy/v5/detail/core.h b/include/proxy/v5/detail/core.h index 5714fc16..a48c4898 100644 --- a/include/proxy/v5/detail/core.h +++ b/include/proxy/v5/detail/core.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_CORE_H_ -#define MSFT_PROXY_V5_DETAIL_CORE_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_CORE_H_ +#define NGCPP_PROXY_V5_DETAIL_CORE_H_ #include #include @@ -1799,4 +1799,4 @@ struct weak_facade } // namespace pro::inline v5 -#endif // MSFT_PROXY_V5_DETAIL_CORE_H_ +#endif // NGCPP_PROXY_V5_DETAIL_CORE_H_ diff --git a/include/proxy/v5/detail/dispatch.h b/include/proxy/v5/detail/dispatch.h index a312d5ef..b169e09f 100644 --- a/include/proxy/v5/detail/dispatch.h +++ b/include/proxy/v5/detail/dispatch.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_DISPATCH_H_ -#define MSFT_PROXY_V5_DETAIL_DISPATCH_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_DISPATCH_H_ +#define NGCPP_PROXY_V5_DETAIL_DISPATCH_H_ #include @@ -413,4 +413,4 @@ struct default_access_traits> : default_access_traits {}; } // namespace pro::inline v5 -#endif // MSFT_PROXY_V5_DETAIL_DISPATCH_H_ +#endif // NGCPP_PROXY_V5_DETAIL_DISPATCH_H_ diff --git a/include/proxy/v5/detail/facade_creation.h b/include/proxy/v5/detail/facade_creation.h index 3717a626..b5c577c5 100644 --- a/include/proxy/v5/detail/facade_creation.h +++ b/include/proxy/v5/detail/facade_creation.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ -#define MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_FACADE_CREATION_H_ +#define NGCPP_PROXY_V5_DETAIL_FACADE_CREATION_H_ #include @@ -125,4 +125,4 @@ using facade_builder = } // namespace pro::inline v5 -#endif // MSFT_PROXY_V5_DETAIL_FACADE_CREATION_H_ +#endif // NGCPP_PROXY_V5_DETAIL_FACADE_CREATION_H_ diff --git a/include/proxy/v5/detail/metadata_policy.h b/include/proxy/v5/detail/metadata_policy.h index d28dea79..e3162c19 100644 --- a/include/proxy/v5/detail/metadata_policy.h +++ b/include/proxy/v5/detail/metadata_policy.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_METADATA_POLICY_H_ -#define MSFT_PROXY_V5_DETAIL_METADATA_POLICY_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_METADATA_POLICY_H_ +#define NGCPP_PROXY_V5_DETAIL_METADATA_POLICY_H_ #include #include @@ -183,4 +183,4 @@ struct inline_metadata { } // namespace pro::inline v5 -#endif // MSFT_PROXY_V5_DETAIL_METADATA_POLICY_H_ +#endif // NGCPP_PROXY_V5_DETAIL_METADATA_POLICY_H_ diff --git a/include/proxy/v5/detail/proxy_creation.h b/include/proxy/v5/detail/proxy_creation.h index 37ef2f49..13a3fb58 100644 --- a/include/proxy/v5/detail/proxy_creation.h +++ b/include/proxy/v5/detail/proxy_creation.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ -#define MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_PROXY_CREATION_H_ +#define NGCPP_PROXY_V5_DETAIL_PROXY_CREATION_H_ #include #include @@ -444,4 +444,4 @@ constexpr proxy make_proxy_shared(std::initializer_list il, } // namespace pro::inline v5 -#endif // MSFT_PROXY_V5_DETAIL_PROXY_CREATION_H_ +#endif // NGCPP_PROXY_V5_DETAIL_PROXY_CREATION_H_ diff --git a/include/proxy/v5/detail/skills.h b/include/proxy/v5/detail/skills.h index 626a0552..41d278a9 100644 --- a/include/proxy/v5/detail/skills.h +++ b/include/proxy/v5/detail/skills.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_DETAIL_SKILLS_H_ -#define MSFT_PROXY_V5_DETAIL_SKILLS_H_ +#ifndef NGCPP_PROXY_V5_DETAIL_SKILLS_H_ +#define NGCPP_PROXY_V5_DETAIL_SKILLS_H_ #include #include @@ -423,4 +423,4 @@ struct formatter } // namespace std #endif // PRO5D_HAS_FORMAT -#endif // MSFT_PROXY_V5_DETAIL_SKILLS_H_ +#endif // NGCPP_PROXY_V5_DETAIL_SKILLS_H_ diff --git a/include/proxy/v5/proxy.h b/include/proxy/v5/proxy.h index 3da216e5..a8ece70e 100644 --- a/include/proxy/v5/proxy.h +++ b/include/proxy/v5/proxy.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_PROXY_H_ -#define MSFT_PROXY_V5_PROXY_H_ +#ifndef NGCPP_PROXY_V5_PROXY_H_ +#define NGCPP_PROXY_V5_PROXY_H_ #include "detail/compatibility_check.h" // IWYU pragma: keep #include "detail/core.h" // IWYU pragma: export @@ -12,4 +12,4 @@ #include "detail/proxy_creation.h" // IWYU pragma: export #include "detail/skills.h" // IWYU pragma: export -#endif // MSFT_PROXY_V5_PROXY_H_ +#endif // NGCPP_PROXY_V5_PROXY_H_ diff --git a/include/proxy/v5/proxy_fmt.h b/include/proxy/v5/proxy_fmt.h index 1f7ac155..c01ed745 100644 --- a/include/proxy/v5/proxy_fmt.h +++ b/include/proxy/v5/proxy_fmt.h @@ -2,15 +2,15 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_PROXY_FMT_H_ -#define MSFT_PROXY_V5_PROXY_FMT_H_ +#ifndef NGCPP_PROXY_V5_PROXY_FMT_H_ +#define NGCPP_PROXY_V5_PROXY_FMT_H_ #include #include -#ifndef __msft_lib_proxy5 +#ifndef __ngcpp_lib_proxy5 #error Please ensure that proxy.h is included before proxy_fmt.h. -#endif // __msft_lib_proxy5 +#endif // __ngcpp_lib_proxy5 #if FMT_VERSION < 60100 #error Please ensure that the appropriate {fmt} headers (version 6.1.0 or \ @@ -59,4 +59,4 @@ struct formatter } // namespace fmt -#endif // MSFT_PROXY_V5_PROXY_FMT_H_ +#endif // NGCPP_PROXY_V5_PROXY_FMT_H_ diff --git a/include/proxy/v5/proxy_macros.h b/include/proxy/v5/proxy_macros.h index 7738c152..49cf556c 100644 --- a/include/proxy/v5/proxy_macros.h +++ b/include/proxy/v5/proxy_macros.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef MSFT_PROXY_V5_PROXY_MACROS_H_ -#define MSFT_PROXY_V5_PROXY_MACROS_H_ +#ifndef NGCPP_PROXY_V5_PROXY_MACROS_H_ +#define NGCPP_PROXY_V5_PROXY_MACROS_H_ #if __cpp_static_call_operator >= 202207L #define PRO5D_STATIC_CALL(ret, ...) static ret operator()(__VA_ARGS__) @@ -29,7 +29,7 @@ #define PRO5D_DEBUG(...) __VA_ARGS__ #endif // NDEBUG -#define __msft_lib_proxy5 202606L +#define __ngcpp_lib_proxy5 202606L #define PRO5D_DIRECT_FUNC_IMPL(...) \ noexcept(noexcept(__VA_ARGS__)) \ @@ -248,17 +248,45 @@ Note: To resolve this error: \n\ - Or use the `" #qualified_name "` macro (note the `5` suffix) to explicitly \ stick to a specific major version of the Proxy library.") +#ifdef __ngcpp_lib_proxy +#undef __ngcpp_lib_proxy +#define __ngcpp_lib_proxy \ + [] { \ + PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(__ngcpp_lib_proxy, \ + __ngcpp_lib_proxy5); \ + return 0L; \ + }() +#else +#define __ngcpp_lib_proxy __ngcpp_lib_proxy5 +#endif // __ngcpp_lib_proxy + +// Deprecated Microsoft-era feature-test macro aliases + +#define PRO5D_DEPRECATED_MSFT_LIB_PROXY5 __ngcpp_lib_proxy5 +#define __msft_lib_proxy5 PRO5D_DEPRECATED_MSFT_LIB_PROXY5 + #ifdef __msft_lib_proxy #undef __msft_lib_proxy -#define __msft_lib_proxy \ +#define PRO5D_DEPRECATED_MSFT_LIB_PROXY \ [] { \ PRO5D_AMBIGUOUS_MACRO_DIAGNOSTIC_ASSERT(__msft_lib_proxy, \ - __msft_lib_proxy5); \ + __ngcpp_lib_proxy5); \ return 0L; \ }() #else -#define __msft_lib_proxy __msft_lib_proxy5 +#define PRO5D_DEPRECATED_MSFT_LIB_PROXY __ngcpp_lib_proxy #endif // __msft_lib_proxy +#define __msft_lib_proxy PRO5D_DEPRECATED_MSFT_LIB_PROXY + +#if defined(__clang__) +#pragma clang deprecated(PRO5D_DEPRECATED_MSFT_LIB_PROXY5, \ + "use __ngcpp_lib_proxy5 instead") +#pragma clang deprecated(PRO5D_DEPRECATED_MSFT_LIB_PROXY, \ + "use __ngcpp_lib_proxy instead") +#elif defined(_MSC_VER) +#pragma deprecated("PRO5D_DEPRECATED_MSFT_LIB_PROXY5") +#pragma deprecated("PRO5D_DEPRECATED_MSFT_LIB_PROXY") +#endif #ifdef PRO_DEF_MEM_DISPATCH #undef PRO_DEF_MEM_DISPATCH @@ -305,4 +333,4 @@ stick to a specific major version of the Proxy library.") #define PRO_ENABLE_FREE PRO5_ENABLE_FREE #endif // PRO_ENABLE_FREE -#endif // MSFT_PROXY_V5_PROXY_MACROS_H_ +#endif // NGCPP_PROXY_V5_PROXY_MACROS_H_ diff --git a/meson.build b/meson.build index d546beb4..00c56b53 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project( - 'msft_proxy5', + 'ngcpp_proxy5', 'cpp', version: '5.0.0', license: 'MIT', @@ -50,7 +50,7 @@ endif inc = include_directories('include') -msft_proxy5_dep = declare_dependency( +ngcpp_proxy5_dep = declare_dependency( include_directories: inc, ) @@ -70,7 +70,7 @@ if pkgconfig.found() ) endif -meson.override_dependency(meson.project_name(), msft_proxy5_dep) +meson.override_dependency(meson.project_name(), ngcpp_proxy5_dep) tests = get_option('tests').disable_auto_if(meson.is_subproject()) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d0777109..2e59ee34 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -project(msft_proxy_tests) +project(ngcpp_proxy_tests) FetchContent_Declare( googletest @@ -11,7 +11,7 @@ FetchContent_MakeAvailable(googletest) include(GoogleTest) add_executable( - msft_proxy_tests + ngcpp_proxy_tests proxy_creation_tests.cpp proxy_detail_tests.cpp proxy_dispatch_tests.cpp @@ -29,12 +29,12 @@ add_executable( proxy_traits_tests.cpp proxy_view_tests.cpp ) -target_include_directories(msft_proxy_tests PRIVATE .) +target_include_directories(ngcpp_proxy_tests PRIVATE .) target_link_libraries( - msft_proxy_tests - PRIVATE msft_proxy5::proxy gtest_main fmt::fmt + ngcpp_proxy_tests + PRIVATE ngcpp_proxy5::proxy gtest_main fmt::fmt ) -target_compile_options(msft_proxy_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS}) -gtest_discover_tests(msft_proxy_tests) +target_compile_options(ngcpp_proxy_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS}) +gtest_discover_tests(ngcpp_proxy_tests) add_subdirectory(modules) diff --git a/tests/freestanding/CMakeLists.txt b/tests/freestanding/CMakeLists.txt index 61a77d45..165db3ee 100644 --- a/tests/freestanding/CMakeLists.txt +++ b/tests/freestanding/CMakeLists.txt @@ -1,26 +1,26 @@ -add_executable(msft_proxy_freestanding_tests proxy_freestanding_tests.cpp) +add_executable(ngcpp_proxy_freestanding_tests proxy_freestanding_tests.cpp) target_compile_options( - msft_proxy_freestanding_tests + ngcpp_proxy_freestanding_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS} ) -target_link_libraries(msft_proxy_freestanding_tests PRIVATE msft_proxy5::proxy) -add_test(NAME ProxyFreestandingTests COMMAND msft_proxy_freestanding_tests) +target_link_libraries(ngcpp_proxy_freestanding_tests PRIVATE ngcpp_proxy5::proxy) +add_test(NAME ProxyFreestandingTests COMMAND ngcpp_proxy_freestanding_tests) if(PROXY_BUILD_MODULES) add_executable( - msft_proxy_freestanding_module_tests + ngcpp_proxy_freestanding_module_tests proxy_freestanding_module_tests.cpp ) target_compile_options( - msft_proxy_freestanding_module_tests + ngcpp_proxy_freestanding_module_tests PRIVATE ${PROXY_STRICT_WARNING_FLAGS} ) target_link_libraries( - msft_proxy_freestanding_module_tests - PRIVATE msft_proxy5::proxy_module + ngcpp_proxy_freestanding_module_tests + PRIVATE ngcpp_proxy5::proxy_module ) add_test( NAME ProxyFreestandingModuleSupportTests - COMMAND msft_proxy_freestanding_module_tests + COMMAND ngcpp_proxy_freestanding_module_tests ) endif() diff --git a/tests/freestanding/meson.build b/tests/freestanding/meson.build index 3b12c5f3..388efd43 100644 --- a/tests/freestanding/meson.build +++ b/tests/freestanding/meson.build @@ -1,10 +1,10 @@ test( 'ProxyFreestandingTests', executable( - 'msft_proxy_freestanding_tests', + 'ngcpp_proxy_freestanding_tests', files('proxy_freestanding_tests.cpp'), implicit_include_directories: false, - dependencies: msft_proxy5_dep, + dependencies: ngcpp_proxy5_dep, override_options: { 'werror': true, }, diff --git a/tests/meson.build b/tests/meson.build index 85261701..2522b0d1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -15,7 +15,7 @@ test_srcs = files( 'proxy_view_tests.cpp', ) -test_deps = [msft_proxy5_dep, gtest_dep] +test_deps = [ngcpp_proxy5_dep, gtest_dep] if fmt_dep.found() test_srcs += files( @@ -28,7 +28,7 @@ endif test( 'ProxyTests', executable( - 'msft_proxy_tests', + 'ngcpp_proxy_tests', test_srcs, implicit_include_directories: false, dependencies: test_deps, diff --git a/tests/modules/CMakeLists.txt b/tests/modules/CMakeLists.txt index bc9ef9be..c3710517 100644 --- a/tests/modules/CMakeLists.txt +++ b/tests/modules/CMakeLists.txt @@ -1,8 +1,8 @@ if(PROXY_BUILD_MODULES) - target_sources(msft_proxy_tests PRIVATE main.cpp) + target_sources(ngcpp_proxy_tests PRIVATE main.cpp) target_sources( - msft_proxy_tests + ngcpp_proxy_tests PRIVATE FILE_SET CXX_MODULES FILES foo.ixx impl.ixx ) - target_link_libraries(msft_proxy_tests PRIVATE msft_proxy5::proxy_module) + target_link_libraries(ngcpp_proxy_tests PRIVATE ngcpp_proxy5::proxy_module) endif() diff --git a/tests/utils.h b/tests/utils.h index 0784eccb..f8a37184 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -2,8 +2,8 @@ // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. -#ifndef _MSFT_PROXY_TEST_UTILS_ -#define _MSFT_PROXY_TEST_UTILS_ +#ifndef _NGCPP_PROXY_TEST_UTILS_ +#define _NGCPP_PROXY_TEST_UTILS_ #include #include @@ -169,4 +169,4 @@ class RttiMetadata { } // namespace utils -#endif // _MSFT_PROXY_TEST_UTILS_ +#endif // _NGCPP_PROXY_TEST_UTILS_ From ce6fe47a6d16d50abb05484f50dde4920f202ebd Mon Sep 17 00:00:00 2001 From: Mingxin Wang Date: Sat, 21 Nov 2026 23:29:41 +0800 Subject: [PATCH 2/2] Clarify the deprecation warnings of the msft feature-test macros - Named the deprecated macro in the Clang messages, because Clang reports the internal PRO5D_DEPRECATED_* helper rather than the macro the user wrote, and capitalized them like the existing [[deprecated]] messages. - Used #ifdef and a trailing #endif comment for the compiler switch, following the rest of proxy_macros.h. - Documented that Clang and MSVC warn only when an alias is expanded and that GCC cannot deprecate a macro, replacing the vague "supporting compilers". - Realigned the feature-test macro row of the macro table in the spec index. --- docs/spec/README.md | 2 +- docs/spec/ngcpp_lib_proxy.md | 2 +- include/proxy/v5/proxy_macros.h | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/spec/README.md b/docs/spec/README.md index a0502596..51c7e52f 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -75,7 +75,7 @@ Also included in `proxy.h`. | Name | Description | | ------------------------------------------------------------ | ------------------------------------------------------------ | -| [`__ngcpp_lib_proxy`](ngcpp_lib_proxy.md) | Feature test macro | +| [`__ngcpp_lib_proxy`](ngcpp_lib_proxy.md) | Feature test macro | | [`PRO_DEF_FREE_AS_MEM_DISPATCH` ](PRO_DEF_FREE_AS_MEM_DISPATCH.md) | Defines a dispatch type for free function call expressions with accessibility via a member function | | [`PRO_DEF_FREE_DISPATCH`](PRO_DEF_FREE_DISPATCH.md) | Defines a dispatch type for free function call expressions with accessibility | | [`PRO_DEF_MEM_DISPATCH`](PRO_DEF_MEM_DISPATCH.md) | Defines a dispatch type for member function call expressions with accessibility | diff --git a/docs/spec/ngcpp_lib_proxy.md b/docs/spec/ngcpp_lib_proxy.md index 68d21e23..ab6595b9 100644 --- a/docs/spec/ngcpp_lib_proxy.md +++ b/docs/spec/ngcpp_lib_proxy.md @@ -22,7 +22,7 @@ Starting with 3.0.0, Proxy ships a feature-test macro that encodes the library v | 3.1.0 | `__msft_lib_proxy` | `202410L` | | 3.0.0 | `__msft_lib_proxy` | `202408L` | -`__msft_lib_proxy` and its major-qualified form `__msft_lib_proxy5` are retained as deprecated aliases for backward compatibility. Supporting compilers issue a deprecation warning when either alias is used. +`__msft_lib_proxy` and its major-qualified form `__msft_lib_proxy5` are retained as deprecated aliases for backward compatibility. Clang and MSVC issue a deprecation warning when either alias is expanded, but not when it is only tested with `#ifdef` or `defined`. GCC has no facility to deprecate a macro, so it accepts both aliases without a warning. ## Example diff --git a/include/proxy/v5/proxy_macros.h b/include/proxy/v5/proxy_macros.h index 49cf556c..a636c311 100644 --- a/include/proxy/v5/proxy_macros.h +++ b/include/proxy/v5/proxy_macros.h @@ -278,15 +278,16 @@ stick to a specific major version of the Proxy library.") #endif // __msft_lib_proxy #define __msft_lib_proxy PRO5D_DEPRECATED_MSFT_LIB_PROXY -#if defined(__clang__) -#pragma clang deprecated(PRO5D_DEPRECATED_MSFT_LIB_PROXY5, \ - "use __ngcpp_lib_proxy5 instead") +#ifdef __clang__ +#pragma clang deprecated( \ + PRO5D_DEPRECATED_MSFT_LIB_PROXY5, \ + "Use __ngcpp_lib_proxy5 instead of __msft_lib_proxy5") #pragma clang deprecated(PRO5D_DEPRECATED_MSFT_LIB_PROXY, \ - "use __ngcpp_lib_proxy instead") + "Use __ngcpp_lib_proxy instead of __msft_lib_proxy") #elif defined(_MSC_VER) #pragma deprecated("PRO5D_DEPRECATED_MSFT_LIB_PROXY5") #pragma deprecated("PRO5D_DEPRECATED_MSFT_LIB_PROXY") -#endif +#endif // __clang__ #ifdef PRO_DEF_MEM_DISPATCH #undef PRO_DEF_MEM_DISPATCH