Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
Mark Mentovai
2013/02/28 15:39:22
2013
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BASE_EXPORT_TEMPLATE_TYPE_H_ | |
| 6 #define EXPORT_TEMPLATE_TYPE_H_ | |
|
Mark Mentovai
2013/02/28 15:39:22
This is not the same name that you check for on th
| |
| 7 | |
| 8 // Class forward declarations usually don't need to be decorated with EXPORT. | |
| 9 // However, clang looks at the visibility of forward declarations for explicit | |
| 10 // template instantiations and hides the instantiated symbols if any of the | |
| 11 // types isn't visible, so class declarations used in explicit macro | |
| 12 // instantiations do need EXPORT. | |
| 13 // But gcc warns "type attributes ignored after type is already defined" if | |
| 14 // it sees an EXPORT on a class declaration after seeing the class itself (which | |
| 15 // can happen depending on include order), so define a macro for this purpose. | |
| 16 // To be used like: | |
| 17 // | |
| 18 // EXPORT_TEMPLATE_TYPE(class, UI_EXPORT, Insets); | |
| 19 // extern template class MyTemplate<Insets>; | |
| 20 | |
| 21 #if defined(__clang__) | |
| 22 #define EXPORT_TEMPLATE_TYPE(kw, export_macro, name) kw export_macro name | |
| 23 #else | |
| 24 #define EXPORT_TEMPLATE_TYPE(kw, export_macro, name) kw name | |
| 25 #endif | |
| 26 | |
| 27 #endif // EXPORT_TEMPLATE_TYPE_H_ | |
| OLD | NEW |