2017-12-09  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* gdb/gnulib/import/math.in.h [__DJGPP__]:  New  macro djgpp_frexpl
	replaces frexpl for DJGPP.







diff -aprNU5 gdb-8.0.1.orig/djgpp/build.sh gdb-8.0.1/djgpp/build.sh
--- gdb-8.0.1.orig/djgpp/build.sh	2017-12-08 21:01:44 +0000
+++ gdb-8.0.1/djgpp/build.sh	2017-12-09 21:22:22 +0000
@@ -81,12 +81,16 @@ export ac_cv_have_decl_fseeko64=${ac_cv_
 export ac_cv_have_decl_ftello64=${ac_cv_have_decl_ftello64=no}
 
 # Ensure that always old GNU extern inline semantics is used
 # (aka -fgnu89-inline) even if ISO C99 semantics has been specified.
 case $(gcc --version 2>/dev/null | sed "/^.* \([1-9]\+\.[0-9]\+[.0-9]*\).*$/!d;s/^.* \([1-9]\+\.[0-9]\+[.0-9]*\).*$/\1/") in
-[1-3].*|4.[0-1][.0-9]* )  export CFLAGS=${CFLAGS='-g2 -O2 -march=i386 -mtune=i586'};;
-* )                       export CFLAGS=${CFLAGS='-g2 -O2 -fgnu89-inline -march=i386 -mtune=i586'};;
+[1-3].*|4.[0-1][.0-9]* )
+  export CFLAGS=${CFLAGS='-g2 -O2 -march=i386 -mtune=i586'};
+  export CPPFLAGS=${CPPFLAGS='-g2 -O2 -march=i386 -mtune=i586'};;
+* )
+  export CFLAGS=${CFLAGS='-g2 -O2 -fgnu89-inline -march=i386 -mtune=i586'};
+  export CPPFLAGS=${CPPFLAGS='-g2 -O2 -march=i386 -mtune=i586'};;
 esac
 
 # DJGPP's implementation of printf survives out-of-memory conditions.
 export gl_cv_func_printf_enomem='yes'
 
@@ -284,10 +288,12 @@ cat > script.sed << EOF
 # undef HAVE_DECL_SNPRINTF\\
 
 
 $ a\\
 #ifdef __DJGPP__\\
+# include <sys/version.h>\\
+\\
 # if defined (__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))\\
 #  define __gnuc_extension__  __extension__\\
 # else\\
 #  define __gnuc_extension__\\
 # endif\\
diff -aprNU5 gdb-8.0.1.orig/gdb/gnulib/import/math.in.h gdb-8.0.1/gdb/gnulib/import/math.in.h
--- gdb-8.0.1.orig/gdb/gnulib/import/math.in.h	2017-05-23 05:44:10 +0000
+++ gdb-8.0.1/gdb/gnulib/import/math.in.h	2017-12-09 02:50:12 +0000
@@ -998,10 +998,14 @@ _GL_WARN_ON_USE (frexp, "frexp is unport
    where
      If x finite and nonzero: 0.5 <= |mantissa| < 1.0.
      If x is zero: mantissa = x, exp = 0.
      If x is infinite or NaN: mantissa = x, exp unspecified.
    Store exp in *EXPPTR and return mantissa.  */
+#if 0  //ifdef __DJGPP__
+# undef frexpl
+# define frexpl djgpp_frexpl
+#endif
 #if @GNULIB_FREXPL@ && @REPLACE_FREXPL@
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef frexpl
 #  define frexpl rpl_frexpl
 # endif
