Blame SOURCES/gcc48-libc-name.patch

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