Make sure macros in the include subdirectory are not used without being defined.
authorBob Wilson <bob.wilson@apple.com>
Tue, 4 Sep 2012 17:42:53 +0000 (17:42 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 4 Sep 2012 17:42:53 +0000 (17:42 +0000)
commite20cf3d14997c3511e264748c59687a801caa6ed
tree9579fdbcaaf2bfeef6dfe0a2b8ba74d7e9981c2a
parent3e59040810d0e6e04269ac8f781fa44df6088458
Make sure macros in the include subdirectory are not used without being defined.

Rationale: For each preprocessor macro, either the definedness is what's
meaningful, or the value is what's meaningful, or both. If definedness is
meaningful, we should use #ifdef. If the value is meaningful, we should use
and #ifdef interchangeably for the same macro, seems ugly to me, even if
undefined macros are zero if used.

This also has the benefit that including an LLVM header doesn't prevent
you from compiling with -Wundef -Werror.

Patch by John Garvin!
<rdar://problem/12189979>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163148 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm-c/Core.h
include/llvm/Support/Compiler.h
include/llvm/Support/FileSystem.h