зеркало из https://github.com/microsoft/cppwinrt.git
e53db0f9f6
Why is this change being made? Someone is trying to upgrade the cppwinrt version used by a large project that has many static libraries using cppwinrt. Some binaries in that project are mixing static libs with different cpp language versions. (This seems like not a great idea generally but it is the state of the world so to some degree we have to live with it). In those binaries the ODR checks for cppwinrt source_location usage are breaking the build. For good reason, it is not safe to mix this functionality across language versions. This set of changes is aimed at making that upgrade process easier without losing any useful functionality. Briefly summarize what changed We already have winrt::impl::slim_source_location which is a lot like std::source_location, minus always containing the very impactful FUNCTION data. This type is powered by the same intrinsics as the STL version so it works as well as the STL library. The existence of this class means that we can avoid the ODR violations by always using winrt::impl::slim_source_location. Some new macros are used to control what goes into the constructor. cpp20 code that does not suppress source_location will get valid source information passed in. Code that is cpp17, or suppresses this feature, will have zero's passed in. Furthermore, when compiling as _DEBUG this will also include the FUNCTION data, matching previous behavior. The net result is that there is no more ODR violation because the function signatures are always the same. How was this change tested? build_test_all.cmd for both release and debug. I also created a little project that mixes cpp17 and cpp20 libraries. With the latest public release of cppwinrt this project does not build because of the ODR violations. With these changes it builds and runs as expected. |
||
---|---|---|
.. | ||
base_abi.h | ||
base_activation.h | ||
base_agile_ref.h | ||
base_array.h | ||
base_chrono.h | ||
base_collections.h | ||
base_collections_base.h | ||
base_collections_input_iterable.h | ||
base_collections_input_map.h | ||
base_collections_input_map_view.h | ||
base_collections_input_vector.h | ||
base_collections_input_vector_view.h | ||
base_collections_map.h | ||
base_collections_vector.h | ||
base_com_ptr.h | ||
base_composable.h | ||
base_coroutine_foundation.h | ||
base_coroutine_system.h | ||
base_coroutine_system_winui.h | ||
base_coroutine_threadpool.h | ||
base_coroutine_ui_core.h | ||
base_deferral.h | ||
base_delegate.h | ||
base_error.h | ||
base_events.h | ||
base_extern.h | ||
base_fast_forward.h | ||
base_foundation.h | ||
base_handle.h | ||
base_identity.h | ||
base_implements.h | ||
base_includes.h | ||
base_iterator.h | ||
base_lock.h | ||
base_macros.h | ||
base_marshaler.h | ||
base_meta.h | ||
base_natvis.h | ||
base_reference_produce.h | ||
base_reference_produce_1.h | ||
base_security.h | ||
base_std_hash.h | ||
base_string.h | ||
base_string_input.h | ||
base_string_operators.h | ||
base_stringable_format.h | ||
base_stringable_format_1.h | ||
base_stringable_streams.h | ||
base_stringable_to_hstring.h | ||
base_types.h | ||
base_version.h | ||
base_version_odr.h | ||
base_weak_ref.h | ||
base_windows.h | ||
base_xaml_component_connector.h | ||
base_xaml_component_connector_winui.h | ||
base_xaml_typename.h |