-
Notifications
You must be signed in to change notification settings - Fork 861
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
Putting global objects with short names under a namespace #576
Conversation
…ds using std::string during initialization time.
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.
Fixes #545
srtcore/logging.h
Outdated
|
||
// If the size of the FA name together with severity exceeds the size, | ||
// just skip the former. | ||
if (logger_pfx && strlen(prefix) + strlen(logger_pfx) < MAX_PREFIX_SIZE) |
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.
+1 for ":"
srtcore/logging.h
Outdated
src_config(&config) | ||
{ | ||
// XXX stpcpy desired, but not enough portable | ||
// Composing the exact prefix is not critical, so simply | ||
// cut the prefix, if the lenght is exceeded |
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.
s/lenght/length/
This fix provides the following changes:
logging
namespace. This should keep away any name conflicts with other libraries. This exactly case was believed to cause problems when added to ffmpeg linked to OBS Studio.blog
logger is commented out (it was the one caught with suspected name conflict). This isn't in use, but it was commented out just so that the existing FA can be reused for something else in future.std::string
was removed from the initialization of the global objects. Although it wasn't causing problems with building OBS Studio, as it was initially suspected, keeping the solution using only C standard library keeps it safe against any future problems concerning the order of initialization.