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

HAVE_CXX11_ATOMIC macro should be defined somewhere in headerfiles #667

@xq114

Description

@xq114

glog/src/glog/logging.h.in

Lines 102 to 106 in c1499f6

#ifdef HAVE_CXX11_ATOMIC
#include <atomic>
#elif defined(OS_WINDOWS)
#include <Windows.h>
#endif

Here HAVE_CXX11_ATOMIC is defined in config.h which is generated and used in the build stage, while the macro is missing when the header is included by some other projects. Since the user holds no information about whether or not the macro is defined in the build stage, I think it's necessary to enable the feature by checking @ac_cv_have_cxx11_atomic@ rather then by checking macro definition. At least, the macro should be defined somewhere such as export.h.

Moreover, it has caused incorrect inclusion of windows.h due to that OS_WINDOWS is a commonly defined macro. It's really a torture when debugging for it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions