Commit d8222a3f authored by Nico Weber's avatar Nico Weber

Add a comment at the top of export_template.h explaining the goal of all the template magic.

These macros are used in all of 3 files. Instead of all this magic, maybe the components
that need this should define FOO_TEMPLATE_EXPORT_DECLARE and FOO_TEMPLATE_EXPORT_DEFINE
in their foo_export.h file instead, and make it expand to the right thing there.
That seems a lot simpler and easier to understand.

But for now, let's just add a comment.

Bug: none
Change-Id: I5fd56440a07a4c7ba879af6d809c7e1397d05737
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890531
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarReid Kleckner <rnk@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710908}
parent ddf98dc4
......@@ -26,6 +26,18 @@
// Implementation notes
//
// On Windows, when building the FOO library (that is, when FOO_EXPORT expands
// to __declspec(dllexport)), we want the two lines to expand to:
//
// extern template class foo<bar>;
// template class FOO_EXPORT foo<bar>;
//
// In all other cases (non-Windows, and Windows when using the FOO library (that
// is when FOO_EXPORT expands to __declspec(dllimport)), we want:
//
// extern template class FOO_EXPORT foo<bar>;
// template class foo<bar>;
//
// The implementation of this header uses some subtle macro semantics to
// detect what the provided FOO_EXPORT value was defined as and then
// to dispatch to appropriate macro definitions. Unfortunately,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment