]> granicus.if.org Git - clang/commitdiff
avoid using config.h in public headers
authorDylan Noblesmith <nobled@dreamwidth.org>
Thu, 23 Jun 2011 12:20:57 +0000 (12:20 +0000)
committerDylan Noblesmith <nobled@dreamwidth.org>
Thu, 23 Jun 2011 12:20:57 +0000 (12:20 +0000)
This is the only usage in clang's headers, and it's for a define
that only exists on CMake builds for the sake of the MSVC compiler,
so just use an ifdef instead.

Also add an include for config.h in a file that actually needs it,
and was picking it up by accident indirectly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133710 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/FileManager.h
lib/Frontend/CompilerInstance.cpp

index 2ca344d553701c64dcd0adbcca8ebb0bcf0bb973..1324533fa03e8bb8680074d7c1a01c45ee918ea9 100644 (file)
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/OwningPtr.h"
 #include "llvm/Support/Allocator.h"
-#include "llvm/Config/config.h" // for mode_t
 // FIXME: Enhance libsystem to support inode and other fields in stat.
 #include <sys/types.h>
 
+#ifdef _MSC_VER
+typedef unsigned short mode_t;
+#endif
+
 struct stat;
 
 namespace llvm {
index 38fcfe3c4711fe16f1ffa22c72edec60469f4027..cb91c89e46cafef7004c04bc988718c34a2f6cdd 100644 (file)
@@ -38,6 +38,7 @@
 #include "llvm/Support/Program.h"
 #include "llvm/Support/Signals.h"
 #include "llvm/Support/system_error.h"
+#include "llvm/Config/config.h"
 using namespace clang;
 
 CompilerInstance::CompilerInstance()