From: Alfred Minarik Date: Mon, 6 Aug 2007 11:10:19 +0000 (+0200) Subject: re PR pch/13676 (GCC failes to recognize files ending in .hpp as headers to be precom... X-Git-Tag: releases/gcc-4.3.0~3533 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=5958f5cbe04796aed00e833d45e347d990aba506;p=gcc.git re PR pch/13676 (GCC failes to recognize files ending in .hpp as headers to be precompiled) PR pch/13676 * doc/invoke.texi: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. cp: * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. * g++spec.c (lang_specific_driver): Check them. From-SVN: r127239 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 256381b6738d..62005cf0ce07 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-08-06 Alfred Minarik + + PR pch/13676 + * doc/invoke.texi: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. + 2008-08-05 Andrew Pinski PR middle-end/32988 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 468612de5f8a..eef4d12066e1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-04 Alfred Minarik + + PR pch/13676 + * lang-specs.h: Add .hp, .hxx, .hpp, .h, .HPP, .tcc as c++ header. + * g++spec.c (lang_specific_driver): Check them. + 2007-08-06 Paolo Carlini PR c++/19532 diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 0686de4f89b4..a19a35fa3484 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -235,6 +235,12 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, { if ((len <= 2 || strcmp (argv[i] + (len - 2), ".H") != 0) && (len <= 2 || strcmp (argv[i] + (len - 2), ".h") != 0) + && (len <= 4 || strcmp (argv[i] + (len - 4), ".hpp") != 0) + && (len <= 3 || strcmp (argv[i] + (len - 3), ".hp") != 0) + && (len <= 4 || strcmp (argv[i] + (len - 4), ".hxx") != 0) + && (len <= 4 || strcmp (argv[i] + (len - 4), ".h++") != 0) + && (len <= 4 || strcmp (argv[i] + (len - 4), ".HPP") != 0) + && (len <= 4 || strcmp (argv[i] + (len - 4), ".tcc") != 0) && (len <= 3 || strcmp (argv[i] + (len - 3), ".hh") != 0)) library = 1; } diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h index 7be145d5072d..54d69a115faa 100644 --- a/gcc/cp/lang-specs.h +++ b/gcc/cp/lang-specs.h @@ -33,6 +33,12 @@ along with GCC; see the file COPYING3. If not see {".C", "@c++", 0, 0, 0}, {".CPP", "@c++", 0, 0, 0}, {".H", "@c++-header", 0, 0, 0}, + {".hpp", "@c++-header", 0, 0, 0}, + {".hp", "@c++-header", 0, 0, 0}, + {".hxx", "@c++-header", 0, 0, 0}, + {".h++", "@c++-header", 0, 0, 0}, + {".HPP", "@c++-header", 0, 0, 0}, + {".tcc", "@c++-header", 0, 0, 0}, {".hh", "@c++-header", 0, 0, 0}, {"@c++-header", "%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5a13c42501b2..233dad3b7933 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -913,6 +913,12 @@ Objective-C++ source code which should not be preprocessed. @item @var{file}.hh @itemx @var{file}.H +@itemx @var{file}.hp +@itemx @var{file}.hxx +@itemx @var{file}.hpp +@itemx @var{file}.HPP +@itemx @var{file}.h++ +@itemx @var{file}.tcc C++ header file to be turned into a precompiled header. @item @var{file}.f @@ -1240,7 +1246,8 @@ Display the version number and copyrights of the invoked GCC@. @cindex C++ source file suffixes C++ source files conventionally use one of the suffixes @samp{.C}, @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or -@samp{.cxx}; C++ header files often use @samp{.hh} or @samp{.H}; and +@samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp}, +@samp{.H}, or (for shared template code) @samp{.tcc}; and preprocessed C++ files use the suffix @samp{.ii}. GCC recognizes files with these names and compiles them as C++ programs even if you call the compiler the same way as for compiling C programs (usually