Skip to content

Commit 72dca8d

Browse files
committed
CXX-553 include inline keyword in inline macros
1 parent c6028f8 commit 72dca8d

File tree

9 files changed

+45
-45
lines changed

9 files changed

+45
-45
lines changed

src/bsoncxx/array/value.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class BSONCXX_API value {
8181
///
8282
/// Get a view over the document owned by this value.
8383
///
84-
inline BSONCXX_INLINE array::view view() const noexcept;
85-
inline BSONCXX_INLINE operator array::view() const noexcept;
84+
BSONCXX_INLINE array::view view() const noexcept;
85+
BSONCXX_INLINE operator array::view() const noexcept;
8686

8787
///
8888
/// Transfer ownership of the underlying buffer to the caller.
@@ -100,11 +100,11 @@ class BSONCXX_API value {
100100
std::size_t _length;
101101
};
102102

103-
inline BSONCXX_INLINE array::view value::view() const noexcept {
103+
BSONCXX_INLINE array::view value::view() const noexcept {
104104
return array::view{static_cast<uint8_t*>(_data.get()), _length};
105105
}
106106

107-
inline BSONCXX_INLINE value::operator array::view() const noexcept {
107+
BSONCXX_INLINE value::operator array::view() const noexcept {
108108
return view();
109109
}
110110

src/bsoncxx/b64_ntop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const char Pad64 = '=';
123123
* characters followed by one "=" padding character.
124124
*/
125125

126-
inline BSONCXX_INLINE int
126+
BSONCXX_INLINE int
127127
ntop (std::uint8_t const *src,
128128
std::size_t srclength,
129129
char *target,

src/bsoncxx/config/prelude.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#include <bsoncxx/config/config.hpp>
1616
#include <bsoncxx/export.hpp>
1717

18-
#define BSONCXX_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
18+
#define BSONCXX_INLINE inline __attribute__ ((__visibility__("hidden"), __always_inline__))

src/bsoncxx/document/value.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ class BSONCXX_API value {
8080
///
8181
/// Get a view over the document owned by this value.
8282
///
83-
inline BSONCXX_INLINE document::view view() const noexcept;
83+
BSONCXX_INLINE document::view view() const noexcept;
8484

85-
inline BSONCXX_INLINE operator document::view() const noexcept;
85+
BSONCXX_INLINE operator document::view() const noexcept;
8686

8787
///
8888
/// Transfer ownership of the underlying buffer to the caller.
@@ -101,11 +101,11 @@ class BSONCXX_API value {
101101

102102
};
103103

104-
inline BSONCXX_INLINE document::view value::view() const noexcept {
104+
BSONCXX_INLINE document::view value::view() const noexcept {
105105
return document::view{static_cast<uint8_t*>(_data.get()), _length};
106106
}
107107

108-
inline BSONCXX_INLINE value::operator document::view() const noexcept {
108+
BSONCXX_INLINE value::operator document::view() const noexcept {
109109
return view();
110110
}
111111

src/bsoncxx/types.hpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ struct BSONCXX_API b_double {
8383
BSONCXX_INLINE operator double() { return value; }
8484
};
8585

86-
inline BSONCXX_INLINE bool operator==(const b_double& lhs, const b_double& rhs) {
86+
BSONCXX_INLINE bool operator==(const b_double& lhs, const b_double& rhs) {
8787
return lhs.value == rhs.value;
8888
}
8989

@@ -103,7 +103,7 @@ struct BSONCXX_API b_utf8 {
103103
BSONCXX_INLINE operator stdx::string_view() { return value; }
104104
};
105105

106-
inline BSONCXX_INLINE bool operator==(const b_utf8& lhs, const b_utf8& rhs) {
106+
BSONCXX_INLINE bool operator==(const b_utf8& lhs, const b_utf8& rhs) {
107107
return lhs.value == rhs.value;
108108
}
109109

@@ -118,7 +118,7 @@ struct BSONCXX_API b_document {
118118
BSONCXX_INLINE operator document::view() { return value; }
119119
};
120120

121-
inline BSONCXX_INLINE bool operator==(const b_document& lhs, const b_document& rhs) {
121+
BSONCXX_INLINE bool operator==(const b_document& lhs, const b_document& rhs) {
122122
return lhs.value == rhs.value;
123123
}
124124

@@ -133,7 +133,7 @@ struct BSONCXX_API b_array {
133133
BSONCXX_INLINE operator array::view() { return value; }
134134
};
135135

136-
inline BSONCXX_INLINE bool operator==(const b_array& lhs, const b_array& rhs) {
136+
BSONCXX_INLINE bool operator==(const b_array& lhs, const b_array& rhs) {
137137
return lhs.value == rhs.value;
138138
}
139139

@@ -148,7 +148,7 @@ struct BSONCXX_API b_binary {
148148
const uint8_t* bytes;
149149
};
150150

151-
inline BSONCXX_INLINE bool operator==(const b_binary& lhs, const b_binary& rhs) {
151+
BSONCXX_INLINE bool operator==(const b_binary& lhs, const b_binary& rhs) {
152152
return lhs.sub_type == rhs.sub_type && lhs.size == rhs.size && (std::memcmp(lhs.bytes, rhs.bytes, lhs.size) == 0);
153153
}
154154

@@ -163,7 +163,7 @@ struct BSONCXX_API b_undefined {
163163
static constexpr auto type_id = type::k_undefined;
164164
};
165165

166-
inline BSONCXX_INLINE bool operator==(const b_undefined&, const b_undefined&) {
166+
BSONCXX_INLINE bool operator==(const b_undefined&, const b_undefined&) {
167167
return true;
168168
}
169169

@@ -176,7 +176,7 @@ struct BSONCXX_API b_oid {
176176
oid value;
177177
};
178178

179-
inline BSONCXX_INLINE bool operator==(const b_oid& lhs, const b_oid& rhs) {
179+
BSONCXX_INLINE bool operator==(const b_oid& lhs, const b_oid& rhs) {
180180
return lhs.value == rhs.value;
181181
}
182182

@@ -191,7 +191,7 @@ struct BSONCXX_API b_bool {
191191
BSONCXX_INLINE operator bool() { return value; }
192192
};
193193

194-
inline BSONCXX_INLINE bool operator==(const b_bool& lhs, const b_bool& rhs) {
194+
BSONCXX_INLINE bool operator==(const b_bool& lhs, const b_bool& rhs) {
195195
return lhs.value == rhs.value;
196196
}
197197

@@ -206,7 +206,7 @@ struct BSONCXX_API b_date {
206206
BSONCXX_INLINE operator int64_t() { return value; }
207207
};
208208

209-
inline BSONCXX_INLINE bool operator==(const b_date& lhs, const b_date& rhs) {
209+
BSONCXX_INLINE bool operator==(const b_date& lhs, const b_date& rhs) {
210210
return lhs.value == rhs.value;
211211
}
212212

@@ -221,7 +221,7 @@ struct BSONCXX_API b_null {
221221
static constexpr auto type_id = type::k_null;
222222
};
223223

224-
inline BSONCXX_INLINE bool operator==(const b_null&, const b_null&) {
224+
BSONCXX_INLINE bool operator==(const b_null&, const b_null&) {
225225
return true;
226226
}
227227

@@ -244,7 +244,7 @@ struct BSONCXX_API b_regex {
244244
stdx::string_view options;
245245
};
246246

247-
inline BSONCXX_INLINE bool operator==(const b_regex& lhs, const b_regex& rhs) {
247+
BSONCXX_INLINE bool operator==(const b_regex& lhs, const b_regex& rhs) {
248248
return lhs.regex == rhs.regex && lhs.options == rhs.options;
249249
}
250250

@@ -261,7 +261,7 @@ struct BSONCXX_API b_dbpointer {
261261
oid value;
262262
};
263263

264-
inline BSONCXX_INLINE bool operator==(const b_dbpointer& lhs, const b_dbpointer& rhs) {
264+
BSONCXX_INLINE bool operator==(const b_dbpointer& lhs, const b_dbpointer& rhs) {
265265
return lhs.collection == rhs.collection && lhs.value == rhs.value;
266266
}
267267

@@ -285,7 +285,7 @@ struct BSONCXX_API b_code {
285285
BSONCXX_INLINE operator stdx::string_view() { return code; }
286286
};
287287

288-
inline BSONCXX_INLINE bool operator==(const b_code& lhs, const b_code& rhs) {
288+
BSONCXX_INLINE bool operator==(const b_code& lhs, const b_code& rhs) {
289289
return lhs.code == rhs.code;
290290
}
291291

@@ -309,7 +309,7 @@ struct BSONCXX_API b_symbol {
309309
BSONCXX_INLINE operator stdx::string_view() { return symbol; }
310310
};
311311

312-
inline BSONCXX_INLINE bool operator==(const b_symbol& lhs, const b_symbol& rhs) {
312+
BSONCXX_INLINE bool operator==(const b_symbol& lhs, const b_symbol& rhs) {
313313
return lhs.symbol == rhs.symbol;
314314
}
315315

@@ -332,7 +332,7 @@ struct BSONCXX_API b_codewscope {
332332
document::view scope;
333333
};
334334

335-
inline BSONCXX_INLINE bool operator==(const b_codewscope& lhs, const b_codewscope& rhs) {
335+
BSONCXX_INLINE bool operator==(const b_codewscope& lhs, const b_codewscope& rhs) {
336336
return lhs.code == rhs.code && lhs.scope == rhs.scope;
337337
}
338338

@@ -347,7 +347,7 @@ struct BSONCXX_API b_int32 {
347347
BSONCXX_INLINE operator int32_t() { return value; }
348348
};
349349

350-
inline BSONCXX_INLINE bool operator==(const b_int32& lhs, const b_int32& rhs) {
350+
BSONCXX_INLINE bool operator==(const b_int32& lhs, const b_int32& rhs) {
351351
return lhs.value == rhs.value;
352352
}
353353

@@ -365,7 +365,7 @@ struct BSONCXX_API b_timestamp {
365365
uint32_t timestamp;
366366
};
367367

368-
inline BSONCXX_INLINE bool operator==(const b_timestamp& lhs, const b_timestamp& rhs) {
368+
BSONCXX_INLINE bool operator==(const b_timestamp& lhs, const b_timestamp& rhs) {
369369
return lhs.increment == rhs.increment && lhs.timestamp == rhs.timestamp;
370370
}
371371

@@ -380,7 +380,7 @@ struct BSONCXX_API b_int64 {
380380
BSONCXX_INLINE operator int64_t() { return value; }
381381
};
382382

383-
inline BSONCXX_INLINE bool operator==(const b_int64& lhs, const b_int64& rhs) {
383+
BSONCXX_INLINE bool operator==(const b_int64& lhs, const b_int64& rhs) {
384384
return lhs.value == rhs.value;
385385
}
386386

@@ -395,7 +395,7 @@ struct BSONCXX_API b_minkey {
395395
static constexpr auto type_id = type::k_minkey;
396396
};
397397

398-
inline BSONCXX_INLINE bool operator==(const b_minkey&, const b_minkey&) {
398+
BSONCXX_INLINE bool operator==(const b_minkey&, const b_minkey&) {
399399
return true;
400400
}
401401

@@ -410,12 +410,12 @@ struct BSONCXX_API b_maxkey {
410410
static constexpr auto type_id = type::k_maxkey;
411411
};
412412

413-
inline BSONCXX_INLINE bool operator==(const b_maxkey&, const b_maxkey&) {
413+
BSONCXX_INLINE bool operator==(const b_maxkey&, const b_maxkey&) {
414414
return true;
415415
}
416416

417417
#define BSONCXX_ENUM(name, val) \
418-
inline BSONCXX_INLINE bool operator!=(const b_##name& lhs, const b_##name& rhs) { \
418+
BSONCXX_INLINE bool operator!=(const b_##name& lhs, const b_##name& rhs) { \
419419
return !(lhs == rhs); \
420420
}
421421
#include <bsoncxx/enums/type.hpp>

src/mongocxx/client.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ class MONGOCXX_API client {
164164
///
165165
/// @return Client side representation of a server side database
166166
///
167-
inline MONGOCXX_INLINE class database operator[](bsoncxx::stdx::string_view name) const &;
168-
inline MONGOCXX_INLINE class database operator[](bsoncxx::stdx::string_view name) const && = delete;
167+
MONGOCXX_INLINE class database operator[](bsoncxx::stdx::string_view name) const &;
168+
MONGOCXX_INLINE class database operator[](bsoncxx::stdx::string_view name) const && = delete;
169169

170170
private:
171171
friend class database;
@@ -176,7 +176,7 @@ class MONGOCXX_API client {
176176

177177
};
178178

179-
inline MONGOCXX_INLINE database client::operator[](bsoncxx::stdx::string_view name) const & {
179+
MONGOCXX_INLINE database client::operator[](bsoncxx::stdx::string_view name) const & {
180180
return database(name);
181181
}
182182

src/mongocxx/collection.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class MONGOCXX_API collection {
129129
/// @see http://docs.mongodb.org/manual/core/bulk-write-operations/
130130
///
131131
template<typename container_type>
132-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> bulk_write(
132+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> bulk_write(
133133
const container_type& writes,
134134
const options::bulk_write& options = options::bulk_write()
135135
);
@@ -156,7 +156,7 @@ class MONGOCXX_API collection {
156156
/// @see http://docs.mongodb.org/manual/core/bulk-write-operations/
157157
///
158158
template<typename write_model_iterator_type>
159-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> bulk_write(
159+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> bulk_write(
160160
write_model_iterator_type begin,
161161
write_model_iterator_type end,
162162
const options::bulk_write& options = options::bulk_write()
@@ -426,7 +426,7 @@ class MONGOCXX_API collection {
426426
/// @throws exception::write when the operation fails.
427427
///
428428
template<typename container_type>
429-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> insert_many(
429+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> insert_many(
430430
const container_type& container,
431431
const options::insert& options = options::insert()
432432
);
@@ -455,7 +455,7 @@ class MONGOCXX_API collection {
455455
///
456456
/// TODO: document DocumentViewIterator concept or static assert
457457
template<typename document_view_iterator_type>
458-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> insert_many(
458+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> insert_many(
459459
document_view_iterator_type begin,
460460
document_view_iterator_type end,
461461
const options::insert& options = options::insert()
@@ -588,15 +588,15 @@ class MONGOCXX_API collection {
588588
};
589589

590590
template<typename container_type>
591-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> collection::bulk_write(
591+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> collection::bulk_write(
592592
const container_type& requests,
593593
const options::bulk_write& options
594594
) {
595595
return bulk_write(requests.begin(), requests.end(), options);
596596
}
597597

598598
template<typename write_model_iterator_type>
599-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> collection::bulk_write(
599+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> collection::bulk_write(
600600
write_model_iterator_type begin,
601601
write_model_iterator_type end,
602602
const options::bulk_write& options
@@ -611,15 +611,15 @@ inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::bulk_write> collection::b
611611
}
612612

613613
template<typename container_type>
614-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> collection::insert_many(
614+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> collection::insert_many(
615615
const container_type& container,
616616
const options::insert& options
617617
) {
618618
return insert_many(container.begin(), container.end(), options);
619619
}
620620

621621
template<typename document_view_iterator_type>
622-
inline MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> collection::insert_many(
622+
MONGOCXX_INLINE bsoncxx::stdx::optional<result::insert_many> collection::insert_many(
623623
document_view_iterator_type begin,
624624
document_view_iterator_type end,
625625
const options::insert& options

src/mongocxx/config/prelude.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
#include <mongocxx/config/config.hpp>
1616
#include <mongocxx/export.hpp>
1717

18-
#define MONGOCXX_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
18+
#define MONGOCXX_INLINE inline __attribute__ ((__visibility__("hidden"), __always_inline__))

src/mongocxx/database.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class MONGOCXX_API database {
198198
///
199199
/// @return the collection.
200200
///
201-
inline MONGOCXX_INLINE class collection operator[](bsoncxx::stdx::string_view name) const;
201+
MONGOCXX_INLINE class collection operator[](bsoncxx::stdx::string_view name) const;
202202

203203
private:
204204
friend class client;
@@ -211,7 +211,7 @@ class MONGOCXX_API database {
211211

212212
};
213213

214-
inline MONGOCXX_INLINE collection database::operator[](bsoncxx::stdx::string_view name) const {
214+
MONGOCXX_INLINE collection database::operator[](bsoncxx::stdx::string_view name) const {
215215
return collection(name);
216216
}
217217

0 commit comments

Comments
 (0)