[m-dev.] diff: fix another problem with <inttypes.h>

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jun 3 22:52:10 AEST 1999


Estimated hours taken: 0.5

configure.in:
	Check for and handle incompatibilities between <inttypes.h>
	and <sys/types.h>.  This is neede because on some systems,
	e.g. SGI IRIX 5.2, you can include <inttypes.h> or <sys/types.h>
	but not both.

Workspace: /mount/munkora/clp/mercury/public/test_mercury/test_dirs/munta/mercury
Index: configure.in
===================================================================
RCS file: /home/staff/zs/imp/mercury/configure.in,v
retrieving revision 1.174
diff -u -c -r1.174 configure.in
/usr/local/bin/diff: conflicting specifications of output style
*** 1.174	1999/06/02 19:48:32
--- configure.in	1999/06/03 12:40:20
***************
*** 663,682 ****
  	fi
  fi
  #-----------------------------------------------------------------------------#
  AC_CHECK_HEADER(stdint.h, HAVE_STDINT_H=1)
- if test "$HAVE_STDINT_H" = 1; then
- 	AC_DEFINE(HAVE_STDINT)
- fi
  
! AC_CHECK_HEADER(inttypes.h, HAVE_INTTYPES_H=1)
! if test "$HAVE_INTTYPES_H" = 1; then
! 	AC_DEFINE(HAVE_INTTYPES)
  fi
  
- AC_CHECK_HEADER(sys/types.h, HAVE_SYS_TYPES_H=1)
  if test "$HAVE_SYS_TYPES_H" = 1; then
  	AC_DEFINE(HAVE_SYS_TYPES)
  fi
  #-----------------------------------------------------------------------------#
  AC_MSG_CHECKING(for intptr_t)
  AC_CACHE_VAL(mercury_cv_have_intptr_t,
--- 663,703 ----
  	fi
  fi
  #-----------------------------------------------------------------------------#
+ AC_CHECK_HEADER(sys/types.h, HAVE_SYS_TYPES_H=1)
+ AC_CHECK_HEADER(inttypes.h, HAVE_INTTYPES_H=1)
  AC_CHECK_HEADER(stdint.h, HAVE_STDINT_H=1)
  
! # On some systems, e.g. SGI IRIX 5.2, you can include
! # <inttypes.h>, or <sys/types.h>, but not both!
! 
! if test "$HAVE_INTTYPES_H" = 1 && test "$HAVE_SYS_TYPES_H" = 1; then
! 	AC_CACHE_VAL(mercury_cv_inttypes_compat,
! 	AC_MSG_CHECKING(whether inttypes.h is compatible with sys/types.h)
! 	AC_TRY_COMPILE([
! 		#include <inttypes.h>
! 		#include <sys/types.h>
! 	],
! 	[],
! 	[mercury_cv_inttypes_compat=yes], [mercury_cv_inttypes_compat=no]))
! 	AC_MSG_RESULT($mercury_cv_inttypes_compat)
! 
! 	# If <inttypes.h> is not compatible with <sys/types.h>, then
! 	# don't use it.
! 	if test "$mercury_cv_inttypes_compat" = no; then
! 		HAVE_INTYPES_H=0
! 	fi
  fi
  
  if test "$HAVE_SYS_TYPES_H" = 1; then
  	AC_DEFINE(HAVE_SYS_TYPES)
  fi
+ if test "$HAVE_INTTYPES_H" = 1; then
+ 	AC_DEFINE(HAVE_INTTYPES)
+ fi
+ if test "$HAVE_STDINT_H" = 1; then
+ 	AC_DEFINE(HAVE_STDINT)
+ fi
+ 
  #-----------------------------------------------------------------------------#
  AC_MSG_CHECKING(for intptr_t)
  AC_CACHE_VAL(mercury_cv_have_intptr_t,

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list