Skip to content

Commit b988c30

Browse files
authored
CXX-3171 Remove obsolete export macros (#1260)
1 parent 5f1e9bf commit b988c30

File tree

16 files changed

+9
-196
lines changed

16 files changed

+9
-196
lines changed

Doxyfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2434,23 +2434,11 @@ PREDEFINED = BSONCXX_ABI_EXPORT_CDECL(...)=__VA_ARGS__ \
24342434
EXPAND_AS_DEFINED = BSONCXX_ABI_CDECL \
24352435
BSONCXX_ABI_EXPORT \
24362436
BSONCXX_ABI_NO_EXPORT \
2437-
BSONCXX_API \
2438-
BSONCXX_CALL \
24392437
BSONCXX_DEPRECATED \
2440-
BSONCXX_DEPRECATED_EXPORT \
2441-
BSONCXX_DEPRECATED_NO_EXPORT \
2442-
BSONCXX_INLINE \
2443-
BSONCXX_PRIVATE \
24442438
MONGOCXX_ABI_CDECL \
24452439
MONGOCXX_ABI_EXPORT \
24462440
MONGOCXX_ABI_NO_EXPORT \
2447-
MONGOCXX_API \
2448-
MONGOCXX_CALL \
2449-
MONGOCXX_DEPRECATED \
2450-
MONGOCXX_DEPRECATED_EXPORT \
2451-
MONGOCXX_DEPRECATED_NO_EXPORT \
2452-
MONGOCXX_INLINE \
2453-
MONGOCXX_PRIVATE
2441+
MONGOCXX_DEPRECATED
24542442

24552443
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
24562444
# remove all references to function-like macros that are alone on a line, have

etc/coding_guidelines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class foo {
130130
private:
131131
friend baz;
132132
133-
class MONGOCXX_PRIVATE impl;
133+
class impl;
134134
std::unique_ptr<impl> _impl;
135135
136136
};

src/bsoncxx/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ if(1)
156156
function(bsoncxx_install_export_header TARGET)
157157
set(bsoncxx_export_header_custom_content "")
158158
string(APPEND bsoncxx_export_header_custom_content
159+
"\n"
160+
"#undef BSONCXX_DEPRECATED_EXPORT\n"
161+
"#undef BSONCXX_DEPRECATED_NO_EXPORT\n"
159162
"\n"
160163
"#if defined(_MSC_VER)\n"
161164
"#define BSONCXX_ABI_CDECL __cdecl\n"
@@ -164,12 +167,6 @@ if(1)
164167
"#endif\n"
165168
"\n"
166169
"#define BSONCXX_ABI_EXPORT_CDECL(...) BSONCXX_ABI_EXPORT __VA_ARGS__ BSONCXX_ABI_CDECL\n"
167-
"\n"
168-
"// For backward compatibility. Use BSONCXX_ABI_EXPORT_CDECL instead.\n"
169-
"#define BSONCXX_API BSONCXX_ABI_EXPORT\n"
170-
"\n"
171-
"// For backward compatibility. Use BSONCXX_ABI_NO_EXPORT instead.\n"
172-
"#define BSONCXX_PRIVATE BSONCXX_ABI_NO_EXPORT\n"
173170
)
174171
generate_export_header(${TARGET}
175172
BASE_NAME BSONCXX_ABI

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_array.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class sub_array {
5757
///
5858
/// Inductive base-case for the variadic append(...)
5959
///
60-
BSONCXX_INLINE
6160
void append() {}
6261

6362
private:
@@ -72,7 +71,6 @@ class sub_array {
7271
//
7372
// Concatenates another bson array directly.
7473
//
75-
BSONCXX_INLINE
7674
void append_(concatenate_array array) {
7775
_core->concatenate(array.view());
7876
}

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/builder/basic/sub_document.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class sub_document {
5656
///
5757
/// Inductive base-case for the variadic append(...)
5858
///
59-
BSONCXX_INLINE
6059
void append() {}
6160

6261
private:
@@ -92,7 +91,6 @@ class sub_document {
9291
//
9392
// Concatenates another bson document directly.
9493
//
95-
BSONCXX_INLINE
9694
void append_(concatenate_doc doc) {
9795
_core->concatenate(doc);
9896
}

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/compiler.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@
3636

3737
// clang-format on
3838

39-
// For backward compatibility. Use `inline` instead.
40-
#define BSONCXX_INLINE inline BSONCXX_ABI_NO_EXPORT
41-
42-
// For backward compatibility. Use BSONCXX_ABI_EXPORT_CDECL instead.
43-
#define BSONCXX_CALL BSONCXX_ABI_CDECL
44-
4539
///
4640
/// @file
4741
/// Provides macros for internal use.

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/postlude.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// compiler.hpp
16-
#undef BSONCXX_INLINE
17-
#pragma pop_macro("BSONCXX_INLINE")
18-
#undef BSONCXX_CALL
19-
#pragma pop_macro("BSONCXX_CALL")
20-
2115
// config.hpp (generated by CMake)
2216
#undef BSONCXX_POLY_USE_MNMLSTC
2317
#pragma pop_macro("BSONCXX_POLY_USE_MNMLSTC")
@@ -46,11 +40,7 @@
4640
#pragma pop_macro("BSONCXX_ABI_NO_EXPORT")
4741
#pragma pop_macro("BSONCXX_ABI_CDECL")
4842
#pragma pop_macro("BSONCXX_ABI_EXPORT_CDECL")
49-
#pragma pop_macro("BSONCXX_API")
50-
#pragma pop_macro("BSONCXX_PRIVATE")
5143
#pragma pop_macro("BSONCXX_DEPRECATED")
52-
#pragma pop_macro("BSONCXX_DEPRECATED_EXPORT")
53-
#pragma pop_macro("BSONCXX_DEPRECATED_NO_EXPORT")
5444

5545
// prelude.hpp
5646
#undef BSONCXX_UNREACHABLE

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
#undef BSONCXX_FWD
5050

5151
// compiler.hpp
52-
#pragma push_macro("BSONCXX_INLINE")
53-
#undef BSONCXX_INLINE
54-
#pragma push_macro("BSONCXX_CALL")
55-
#undef BSONCXX_CALL
5652
#pragma push_macro("BSONCXX_IF_MSVC")
5753
#undef BSONCXX_IF_MSVC
5854
#pragma push_macro("BSONCXX_IF_GCC")
@@ -95,16 +91,8 @@
9591
#undef BSONCXX_ABI_CDECL
9692
#pragma push_macro("BSONCXX_ABI_EXPORT_CDECL")
9793
#undef BSONCXX_ABI_EXPORT_CDECL
98-
#pragma push_macro("BSONCXX_API")
99-
#undef BSONCXX_API
100-
#pragma push_macro("BSONCXX_PRIVATE")
101-
#undef BSONCXX_PRIVATE
10294
#pragma push_macro("BSONCXX_DEPRECATED")
10395
#undef BSONCXX_DEPRECATED
104-
#pragma push_macro("BSONCXX_DEPRECATED_EXPORT")
105-
#undef BSONCXX_DEPRECATED
106-
#pragma push_macro("BSONCXX_DEPRECATED_NO_EXPORT")
107-
#undef BSONCXX_DEPRECATED
10896

10997
#include <bsoncxx/config/util.hpp>
11098
//

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/fwd.hpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,6 @@
206206
///
207207
#define BSONCXX_ABI_EXPORT_CDECL(...) BSONCXX_ABI_EXPORT __VA_ARGS__ BSONCXX_ABI_CDECL
208208

209-
///
210-
/// @ingroup bsoncxx-v_noabi-bsoncxx-config-export-hpp
211-
/// Equivalent to @ref BSONCXX_ABI_EXPORT.
212-
///
213-
/// @warning For internal use only!
214-
///
215-
/// @note This is a symbol visibility control macro, NOT a declaration of public API. Public API vs.
216-
/// private API is determined by the placement of the entity being declared (e.g. in a public
217-
/// header, as a public class member, etc.) or by documentation (e.g. absence of "For internal use
218-
/// only!" warnings). See [API and ABI
219-
/// Versioning](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/api-abi-versioning/).
220-
///
221-
#define BSONCXX_API BSONCXX_ABI_EXPORT
222-
223-
///
224-
/// @ingroup bsoncxx-v_noabi-bsoncxx-config-export-hpp
225-
/// Equivalent to `inline` with @ref BSONCXX_ABI_NO_EXPORT.
226-
///
227-
/// @warning For internal use only!
228-
///
229-
/// @note This is a symbol visibility control macro, NOT a declaration of private API. Public API
230-
/// vs. private API is determined by the placement of the entity being declared (e.g. in a detail
231-
/// header, as a private class member, etc.) or by documentation (e.g. "For internal use only!",
232-
/// absence of documentation, etc.). See [API and ABI
233-
/// Versioning](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/api-abi-versioning/).
234-
///
235-
#define BSONCXX_PRIVATE inline BSONCXX_ABI_NO_EXPORT
236-
237209
///
238210
/// @ingroup bsoncxx-v_noabi-bsoncxx-config-export-hpp
239211
/// Declares the associated entity as deprecated.
@@ -242,22 +214,6 @@
242214
///
243215
#define BSONCXX_DEPRECATED
244216

245-
///
246-
/// @ingroup bsoncxx-v_noabi-bsoncxx-config-export-hpp
247-
/// Equivalent to @ref BSONCXX_API and @ref BSONCXX_DEPRECATED.
248-
///
249-
/// @warning For internal use only!
250-
///
251-
#define BSONCXX_DEPRECATED_EXPORT
252-
253-
///
254-
/// @ingroup bsoncxx-v_noabi-bsoncxx-config-export-hpp
255-
/// Equivalent to @ref BSONCXX_PRIVATE and @ref BSONCXX_DEPRECATED.
256-
///
257-
/// @warning For internal use only!
258-
///
259-
#define BSONCXX_DEPRECATED_NO_EXPORT
260-
261217
///
262218
/// @} <!-- bsoncxx/v_noabi/bsoncxx/config/export.hpp -->
263219
///

src/bsoncxx/test/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ if(ENABLE_MACRO_GUARD_TESTS)
8585
PROJECT_NAME bsoncxx
8686
PROJECT_TEST_PROPERTIES_TARGET bsoncxx::test_properties
8787
GUARDED_MACROS
88-
# compiler.hpp
89-
BSONCXX_INLINE
90-
BSONCXX_CALL
91-
9288
# config.hpp (generated by CMake)
9389
BSONCXX_POLY_USE_MNMLSTC
9490
BSONCXX_POLY_USE_SYSTEM_MNMLSTC
@@ -109,11 +105,7 @@ if(ENABLE_MACRO_GUARD_TESTS)
109105
BSONCXX_ABI_NO_EXPORT
110106
BSONCXX_ABI_EXPORT_CDECL
111107
BSONCXX_ABI_EXPORT_CDECL_TESTING
112-
BSONCXX_API
113-
BSONCXX_PRIVATE
114108
BSONCXX_DEPRECATED
115-
BSONCXX_DEPRECATED_EXPORT
116-
BSONCXX_DEPRECATED_NO_EXPORT
117109

118110
# prelude.hpp
119111
BSONCXX_UNREACHABLE

src/mongocxx/CMakeLists.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ if(1)
103103
function(mongocxx_install_export_header TARGET)
104104
set(mongocxx_export_header_custom_content "")
105105
string(APPEND mongocxx_export_header_custom_content
106+
"\n"
107+
"#undef MONGOCXX_DEPRECATED_EXPORT\n"
108+
"#undef MONGOCXX_DEPRECATED_NO_EXPORT\n"
106109
"\n"
107110
"#if defined(_MSC_VER)\n"
108111
"#define MONGOCXX_ABI_CDECL __cdecl\n"
@@ -111,20 +114,11 @@ if(1)
111114
"#endif\n"
112115
"\n"
113116
"#define MONGOCXX_ABI_EXPORT_CDECL(...) MONGOCXX_ABI_EXPORT __VA_ARGS__ MONGOCXX_ABI_CDECL\n"
114-
"\n"
115-
"// For backward compatibility. Use MONGOCXX_ABI_EXPORT_CDECL instead.\n"
116-
"#define MONGOCXX_API MONGOCXX_ABI_EXPORT\n"
117-
"\n"
118-
"// For backward compatibility. Use MONGOCXX_ABI_NO_EXPORT instead.\n"
119-
"#define MONGOCXX_PRIVATE MONGOCXX_ABI_NO_EXPORT\n"
120-
"\n"
121-
"// Declare the entity as deprecated.\n"
122-
"#define MONGOCXX_DEPRECATED MONGOCXX_ABI_DEPRECATED\n"
123117
)
124118
generate_export_header(${TARGET}
125119
BASE_NAME MONGOCXX_ABI
126120
EXPORT_MACRO_NAME MONGOCXX_ABI_EXPORT
127-
DEPRECATED_MACRO_NAME MONGOCXX_ABI_DEPRECATED
121+
DEPRECATED_MACRO_NAME MONGOCXX_DEPRECATED
128122
EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/mongocxx/v_noabi/mongocxx/config/export.hpp
129123
STATIC_DEFINE MONGOCXX_STATIC
130124
CUSTOM_CONTENT_FROM_VARIABLE mongocxx_export_header_custom_content

src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/compiler.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// For backward compatibility. Use `inline` instead.
16-
#define MONGOCXX_INLINE inline MONGOCXX_ABI_NO_EXPORT
17-
18-
// For backward compatibility. Use MONGOCXX_ABI_EXPORT_CDECL instead.
19-
#define MONGOCXX_CALL MONGOCXX_ABI_CDECL
20-
2115
///
2216
/// @file
2317
/// Provides macros for internal use.

src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/postlude.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// compiler.hpp
16-
#undef MONGOCXX_INLINE
17-
#pragma pop_macro("MONGOCXX_INLINE")
18-
#undef MONGOCXX_CALL
19-
#pragma pop_macro("MONGOCXX_CALL")
20-
2115
// version.hpp (generated by CMake)
2216
#undef MONGOCXX_VERSION_STRING
2317
#pragma pop_macro("MONGOCXX_VERSION_STRING")
@@ -37,11 +31,7 @@
3731
#pragma pop_macro("MONGOCXX_ABI_NO_EXPORT")
3832
#pragma pop_macro("MONGOCXX_ABI_CDECL")
3933
#pragma pop_macro("MONGOCXX_ABI_EXPORT_CDECL")
40-
#pragma pop_macro("MONGOCXX_API")
41-
#pragma pop_macro("MONGOCXX_PRIVATE")
4234
#pragma pop_macro("MONGOCXX_DEPRECATED")
43-
#pragma pop_macro("MONGOCXX_DEPRECATED_EXPORT")
44-
#pragma pop_macro("MONGOCXX_DEPRECATED_NO_EXPORT")
4535
#endif
4636

4737
// prelude.hpp

src/mongocxx/include/mongocxx/v_noabi/mongocxx/config/prelude.hpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// compiler.hpp
16-
#pragma push_macro("MONGOCXX_INLINE")
17-
#undef MONGOCXX_INLINE
18-
#pragma push_macro("MONGOCXX_CALL")
19-
#undef MONGOCXX_CALL
20-
2115
// version.hpp (generated by CMake)
2216
#pragma push_macro("MONGOCXX_VERSION_STRING")
2317
#undef MONGOCXX_VERSION_STRING
@@ -41,16 +35,8 @@
4135
#undef MONGOCXX_ABI_CDECL
4236
#pragma push_macro("MONGOCXX_ABI_EXPORT_CDECL")
4337
#undef MONGOCXX_ABI_EXPORT_CDECL
44-
#pragma push_macro("MONGOCXX_API")
45-
#undef MONGOCXX_API
46-
#pragma push_macro("MONGOCXX_PRIVATE")
47-
#undef MONGOCXX_PRIVATE
4838
#pragma push_macro("MONGOCXX_DEPRECATED")
4939
#undef MONGOCXX_DEPRECATED
50-
#pragma push_macro("MONGOCXX_DEPRECATED_EXPORT")
51-
#undef MONGOCXX_DEPRECATED_EXPORT
52-
#pragma push_macro("MONGOCXX_DEPRECATED_NO_EXPORT")
53-
#undef MONGOCXX_DEPRECATED_NO_EXPORT
5440
#endif
5541

5642
#include <mongocxx/config/compiler.hpp>

src/mongocxx/include/mongocxx/v_noabi/mongocxx/fwd.hpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -203,34 +203,6 @@
203203
///
204204
#define MONGOCXX_ABI_EXPORT_CDECL(...) MONGOCXX_ABI_EXPORT __VA_ARGS__ MONGOCXX_ABI_CDECL
205205

206-
///
207-
/// @ingroup mongocxx-v_noabi-mongocxx-config-export-hpp
208-
/// Equivalent to @ref MONGOCXX_ABI_EXPORT.
209-
///
210-
/// @warning For internal use only!
211-
///
212-
/// @note This is a symbol visibility control macro, NOT a declaration of public API. Public API vs.
213-
/// private API is determined by the placement of the entity being declared (e.g. in a public
214-
/// header, as a public class member, etc.) or by documentation (e.g. absence of "For internal use
215-
/// only!" warnings). See [API and ABI
216-
/// Versioning](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/api-abi-versioning/).
217-
///
218-
#define MONGOCXX_API MONGOCXX_ABI_EXPORT
219-
220-
///
221-
/// @ingroup mongocxx-v_noabi-mongocxx-config-export-hpp
222-
/// Equivalent to `inline` with @ref MONGOCXX_ABI_NO_EXPORT.
223-
///
224-
/// @warning For internal use only!
225-
///
226-
/// @note This is a symbol visibility control macro, NOT a declaration of private API. Public API
227-
/// vs. private API is determined by the placement of the entity being declared (e.g. in a detail
228-
/// header, as a private class member, etc.) or by documentation (e.g. "For internal use only!",
229-
/// absence of documentation, etc.). See [API and ABI
230-
/// Versioning](https://www.mongodb.com/docs/languages/cpp/cpp-driver/current/api-abi-versioning/).
231-
///
232-
#define MONGOCXX_PRIVATE inline MONGOCXX_ABI_NO_EXPORT
233-
234206
///
235207
/// @ingroup mongocxx-v_noabi-mongocxx-config-export-hpp
236208
/// Declares the associated entity as deprecated.
@@ -239,22 +211,6 @@
239211
///
240212
#define MONGOCXX_DEPRECATED
241213

242-
///
243-
/// @ingroup mongocxx-v_noabi-mongocxx-config-export-hpp
244-
/// Equivalent to @ref MONGOCXX_API and @ref MONGOCXX_DEPRECATED.
245-
///
246-
/// @warning For internal use only!
247-
///
248-
#define MONGOCXX_DEPRECATED_EXPORT
249-
250-
///
251-
/// @ingroup mongocxx-v_noabi-mongocxx-config-export-hpp
252-
/// Equivalent to @ref MONGOCXX_PRIVATE and @ref MONGOCXX_DEPRECATED.
253-
///
254-
/// @warning For internal use only!
255-
///
256-
#define MONGOCXX_DEPRECATED_NO_EXPORT
257-
258214
///
259215
/// @} <!-- mongocxx/v_noabi/mongocxx/config/export.hpp -->
260216
///

0 commit comments

Comments
 (0)