From 9ea60874aaabe20b9cbfa8bc181c9c1962af28e1 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Mon, 9 Jun 2014 19:09:28 +0000 Subject: [PATCH] Disallow multiple inclusion of clang/Config/config.h Internal config.h headers are only meant to be included from the main file. llvm-svn: 210487 --- clang/include/clang/Config/config.h.cmake | 6 +++++- clang/include/clang/Config/config.h.in | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Config/config.h.cmake b/clang/include/clang/Config/config.h.cmake index 40a6cb3a2e3e..7629ef9129b1 100644 --- a/clang/include/clang/Config/config.h.cmake +++ b/clang/include/clang/Config/config.h.cmake @@ -1,4 +1,8 @@ -#ifndef CONFIG_H +/* This generated file is for internal use. Do not include it from headers. */ + +#ifdef CONFIG_H +#error config.h can only be included once +#else #define CONFIG_H /* Bug report URL. */ diff --git a/clang/include/clang/Config/config.h.in b/clang/include/clang/Config/config.h.in index 450ea9b613e8..1530fefaa53d 100644 --- a/clang/include/clang/Config/config.h.in +++ b/clang/include/clang/Config/config.h.in @@ -1,4 +1,8 @@ -#ifndef CONFIG_H +/* This generated file is for internal use. Do not include it from headers. */ + +#ifdef CONFIG_H +#error config.h can only be included once +#else #define CONFIG_H /* Bug report URL. */