-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(common): adds begin/end inline namespace macros #7456
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,24 @@ | |
GOOGLE_CLOUD_CPP_VEVAL(GOOGLE_CLOUD_CPP_VERSION_MAJOR, \ | ||
GOOGLE_CLOUD_CPP_VERSION_MINOR) | ||
|
||
/** | ||
* Versioned inline namespace that users should generally avoid spelling. | ||
* | ||
* The actual inline namespace name will change with each release, and if you | ||
* use it your code will be tightly coupled to a specific release. Omitting the | ||
* inline namespace name will make upgrading to newer releases easier. | ||
* | ||
* However, applications may need to link multiple versions of the Google Cloud | ||
* C++ Libraries, for example, if they link a library that uses an older | ||
* version of the libraries than they do. This namespace is inlined, so | ||
* applications can use `google::cloud::Foo` in their source, but the symbols | ||
* are versioned, i.e., the symbol becomes `google::cloud::vXYZ::Foo`. | ||
*/ | ||
#define GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN \ | ||
inline namespace GOOGLE_CLOUD_CPP_NS { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that we've limited use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could do that separately. To avoid breaking users, we'd need to keep the old macro name around for a while at least. |
||
#define GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END \ | ||
} // namespace GOOGLE_CLOUD_CPP_NS | ||
|
||
// This preprocessor symbol is deprecated and should never be used anywhere. It | ||
// exists solely for backward compatibility to avoid breaking anyone who may | ||
// have been using it. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these would work as (and be better as)
EXPAND_AS_DEFINED
names.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep them as they are because this is only temporary and the actual change I want to make in about 2 PRs is to change them to be defined as empty string, which should be done like this.