Blame SOURCES/gcc48-libc-name.patch

8178f7
2016-02-19  Jakub Jelinek  <jakub@redhat.com>
8178f7
	    Bernd Edlinger  <bernd.edlinger@hotmail.de>
8178f7
8178f7
	* Make-lang.in: Invoke gperf with -L C++.
8178f7
	* cfns.gperf: Remove prototypes for hash and libc_name_p
8178f7
	inlines.
8178f7
	* cfns.h: Regenerated.
8178f7
	* except.c (nothrow_libfn_p): Adjust.
8178f7
8178f7
--- gcc/cp/Make-lang.in
8178f7
+++ gcc/cp/Make-lang.in
8178f7
@@ -112,7 +112,7 @@ else
8178f7
 # deleting the $(srcdir)/cp/cfns.h file.
8178f7
 $(srcdir)/cp/cfns.h:
8178f7
 endif
8178f7
-	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
8178f7
+	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
8178f7
 		$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
8178f7
 
8178f7
 #
8178f7
--- gcc/cp/cfns.gperf
8178f7
+++ gcc/cp/cfns.gperf
8178f7
@@ -1,3 +1,5 @@
8178f7
+%language=C++
8178f7
+%define class-name libc_name
8178f7
 %{
8178f7
 /* Copyright (C) 2000-2013 Free Software Foundation, Inc.
8178f7
 
8178f7
@@ -16,14 +18,6 @@ for more details.
8178f7
 You should have received a copy of the GNU General Public License
8178f7
 along with GCC; see the file COPYING3.  If not see
8178f7
 <http://www.gnu.org/licenses/>.  */
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#endif
8178f7
-static unsigned int hash (const char *, unsigned int);
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#endif
8178f7
-const char * libc_name_p (const char *, unsigned int);
8178f7
 %}
8178f7
 %%
8178f7
 # The standard C library functions, for feeding to gperf; the result is used
8178f7
--- gcc/cp/cfns.h
8178f7
+++ gcc/cp/cfns.h
8178f7
@@ -1,5 +1,5 @@
8178f7
-/* ANSI-C code produced by gperf version 3.0.3 */
8178f7
-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf  */
8178f7
+/* C++ code produced by gperf version 3.0.4 */
8178f7
+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf  */
8178f7
 
8178f7
 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
8178f7
       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
8178f7
@@ -28,7 +28,7 @@
8178f7
 #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
8178f7
 #endif
8178f7
 
8178f7
-#line 1 "cfns.gperf"
8178f7
+#line 3 "cfns.gperf"
8178f7
 
8178f7
 /* Copyright (C) 2000-2013 Free Software Foundation, Inc.
8178f7
 
8178f7
@@ -47,25 +47,18 @@ for more details.
8178f7
 You should have received a copy of the GNU General Public License
8178f7
 along with GCC; see the file COPYING3.  If not see
8178f7
 <http://www.gnu.org/licenses/>.  */
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#endif
8178f7
-static unsigned int hash (const char *, unsigned int);
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#endif
8178f7
-const char * libc_name_p (const char *, unsigned int);
8178f7
 /* maximum key range = 391, duplicates = 0 */
8178f7
 
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#else
8178f7
-#ifdef __cplusplus
8178f7
-inline
8178f7
-#endif
8178f7
-#endif
8178f7
-static unsigned int
8178f7
-hash (register const char *str, register unsigned int len)
8178f7
+class libc_name
8178f7
+{
8178f7
+private:
8178f7
+  static inline unsigned int hash (const char *str, unsigned int len);
8178f7
+public:
8178f7
+  static const char *libc_name_p (const char *str, unsigned int len);
8178f7
+};
8178f7
+
8178f7
+inline unsigned int
8178f7
+libc_name::hash (register const char *str, register unsigned int len)
8178f7
 {
8178f7
   static const unsigned short asso_values[] =
8178f7
     {
8178f7
@@ -122,14 +115,8 @@ hash (register const char *str, register
8178f7
   return hval + asso_values[(unsigned char)str[len - 1]];
8178f7
 }
8178f7
 
8178f7
-#ifdef __GNUC__
8178f7
-__inline
8178f7
-#ifdef __GNUC_STDC_INLINE__
8178f7
-__attribute__ ((__gnu_inline__))
8178f7
-#endif
8178f7
-#endif
8178f7
 const char *
8178f7
-libc_name_p (register const char *str, register unsigned int len)
8178f7
+libc_name::libc_name_p (register const char *str, register unsigned int len)
8178f7
 {
8178f7
   enum
8178f7
     {
8178f7
--- gcc/cp/except.c
8178f7
+++ gcc/cp/except.c
8178f7
@@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
8178f7
      unless the system headers are playing rename tricks, and if
8178f7
      they are, we don't want to be confused by them.  */
8178f7
   id = DECL_NAME (fn);
8178f7
-  return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
8178f7
+  return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
8178f7
+				   IDENTIFIER_LENGTH (id));
8178f7
 }
8178f7
 
8178f7
 /* Returns nonzero if an exception of type FROM will be caught by a