Commit 092f7be3 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Redesign GCC_FUNC_PRINTF_PTR so that it doesn't define HOST_PTR_PRINTF directly.

Redesign GCC_FUNC_PRINTF_PTR so that it doesn't define HOST_PTR_PRINTF
directly.  Instead, autoconf will only determine whether "%p" works and
its up to machmode.h to base its definition of HOST_PTR_PRINTF on that.
This ensures that machmode.h is always included to get the definition of
HOST_PTR_PRINTF for lossy hosts or cross compiles where "%p" is not
found.
        * aclocal.m4 (GCC_FUNC_PRINTF_PTR): Don't define HOST_PTR_PRINTF.
        Instead, define a new macro HAVE_PRINTF_PTR which only signifies
        whether we have the %p format specifier or not.
        * acconfig.h: Delete stub for HOST_PTR_PRINTF, add HAVE_PRINTF_PTR.
        * machmode.h (HOST_PTR_PRINTF): When determining the definition,
        check HAVE_PRINTF_PTR to see whether "%p" is okay.
        * mips-tfile.c: Include machmode.h to get HOST_PTR_PRINTF.
        * Makefile.in (mips-tfile.o): Depend on machmode.h.

From-SVN: r20953
parent 93de5c31
Mon Jul 6 21:07:14 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* aclocal.m4 (GCC_FUNC_PRINTF_PTR): Don't define HOST_PTR_PRINTF.
Instead, define a new macro HAVE_PRINTF_PTR which only signifies
whether we have the %p format specifier or not.
* acconfig.h: Delete stub for HOST_PTR_PRINTF, add HAVE_PRINTF_PTR.
* machmode.h (HOST_PTR_PRINTF): When determining the definition,
check HAVE_PRINTF_PTR to see whether "%p" is okay.
* mips-tfile.c: Include machmode.h to get HOST_PTR_PRINTF.
* Makefile.in (mips-tfile.o): Depend on machmode.h.
Mon Jul 6 10:42:05 1998 Mark Mitchell <mark@markmitchell.com>
* jump.c (duplicate_loop_exit_test): Don't refuse to copy a
......
......@@ -1498,7 +1498,7 @@ $(out_object_file): $(out_file) $(CONFIG_H) $(TREE_H) \
mips-tfile: mips-tfile.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS)
mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h
mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) system.h machmode.h
mips-tdump: mips-tdump.o version.o $(LIBDEPS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS)
......
/* Define to "%p" if printf supports it, else machmode.h will define it. */
#undef HOST_PTR_PRINTF
/* Define if printf supports "%p". */
#undef HAVE_PRINTF_PTR
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
......
......@@ -78,7 +78,7 @@ main()
gcc_cv_func_printf_ptr=no)
rm -f core core.* *.core])
if test $gcc_cv_func_printf_ptr = yes ; then
AC_DEFINE(HOST_PTR_PRINTF, "%p")
AC_DEFINE(HAVE_PRINTF_PTR)
fi
])
......
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define to "%p" if printf supports it, else machmode.h will define it. */
#undef HOST_PTR_PRINTF
/* Define if printf supports "%p". */
#undef HAVE_PRINTF_PTR
/* Define if you want expensive run-time checks. */
#undef ENABLE_CHECKING
......
......@@ -53,10 +53,14 @@ Boston, MA 02111-1307, USA. */
/* Provide a default way to print an address in hex via printf. */
#ifndef HOST_PTR_PRINTF
#define HOST_PTR_PRINTF \
(sizeof (int) == sizeof (char *) ? "%x" \
: sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
#endif
# ifdef HAVE_PRINTF_PTR
# define HOST_PTR_PRINTF "%p"
# else
# define HOST_PTR_PRINTF \
(sizeof (int) == sizeof (char *) ? "%x" \
: sizeof (long) == sizeof (char *) ? "%lx" : "%llx")
# endif
#endif /* ! HOST_PTR_PRINTF */
/* Provide defaults for the way to print a HOST_WIDE_INT
in various manners. */
......
......@@ -713,6 +713,8 @@ main ()
#include <stab.h> /* On BSD, use the system's stab.h. */
#endif /* not USG */
#include "machmode.h"
#ifdef __GNU_STAB__
#define STAB_CODE_TYPE enum __stab_debug_code
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment