Add extern "C++" scope for the C++ template.
Fix test_cppext when Python is built with --with-valgrind.
#if DYNAMIC_ANNOTATIONS_ENABLED != 0 && defined(__cplusplus)
+extern "C++" {
/* _Py_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads.
Instead of doing
_Py_ANNOTATE_IGNORE_READS_END();
return res;
}
+}
+
/* Apply _Py_ANNOTATE_BENIGN_RACE_SIZED to a static variable. */
#define _Py_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \
namespace { \
--- /dev/null
+Fix ``dynamic_annotations.h`` header file when built with C++ and Valgrind:
+add ``extern "C++" scope`` for the C++ template. Patch by Victor Stinner.