[GRASS5] compilation HP-UX

Glynn Clements glynn.clements at virgin.net
Thu May 31 00:06:45 EDT 2001


Eric G. Miller wrote:

> > - d.area with the following message 
> > 
> > >>>>
> > 	gcc -g -O2  -I/opt/libpng/include -I/local/grass5.0.0pre1/src/include   
> >              -c plot.c -o OBJ.hppa1.1-hp-hpux10.20/plot.o
> > In file included from plot.c:18:
> > screenpoly.h:39: warning: redefinition of `uint8_t'
> > /usr/include/sys/_inttypes.h:62: warning: `uint8_t' previously declared here
> > screenpoly.h:42: conflicting types for `uint32_t'
> > /usr/include/sys/_inttypes.h:66: previous declaration of `uint32_t'
> > *** Erreur - code de sortie 1
> 
> Dang, I tried to guard for that. "screenpoly.h" is the last include for
> plot.c and has...
> 
> #if !defined(uint8_t)
>   typedef unsigned char uint8_t;
> #endif
> #if !defined(uint32_t)
>   typedef unsigned long uint32_t;
> #endif
> 
> But maybe those aren't working?

"defined" will only work if those names are #define'd, not if they are
typedef'd.

This should be done with the autoconf AC_CHECK_TYPE macro, although I
would suggest at least using "unsigned int" instead of "unsigned long".
IMHO, "long" being 64 bits is a lot more likely than "int" being
something other than 32.

Ideally config.h should define a type which is known to be of the
correct size, e.g.

	#if sizeof(unsigned int) == 4
	typedef unsigned int grass_uint32_t;
	#elif sizeof(unsigned long) == 4
	typedef unsigned long grass_uint32_t;
	#elif sizeof(unsigned short) == 4
	typedef unsigned short grass_uint32_t;
	#else
	#error Unable to find a 32 bit type
	#endif

Then configure.in can use

	AC_CHECK_TYPE(uint32_t, grass_uint32_t)

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list