Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

@sergeyvfx
Copy link
Contributor

The issue was caused by config.h header being included from both
header files and implementation files.

Proposed solution is to have regular header guard in the generated
config.h. Benefit of this solution is that it's least intrusive.
Downside is that it only solves issue for CMake build system, and
autoconf one is not fixed since header template is automatically
generated by autoheader who does not add header guard.

@@ -1,3 +1,6 @@
#ifndef __GLOG_CONFIG_H__
#define __GLOG_CONFIG_H__
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Macro names with prefix underscores are reserved for compiler use. Just change the define into GLOG_CONFIG_H. That should do just fine.

The issue was caused by config.h header being included from both
header files and implementation files.

Proposed solution is to have regular header guard in the generated
config.h. Benefit of this solution is that it's least intrusive.
Downside is that it only solves issue for CMake build system, and
autoconf one is not fixed since header template is automatically
generated by autoheader who does not add header guard.
@sergeyvfx
Copy link
Contributor Author

The patch should now be updated with removed underscores.

@sergiud sergiud added the LGTM label Mar 20, 2018
@sergiud sergiud merged commit 11afec2 into google:master Mar 21, 2018
durswd pushed a commit to durswd/glog that referenced this pull request Sep 2, 2019
Fix redefined warnings from config.h
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants