[GRASS5] [bug #3974] (grass) r.mapcalc/libgis failure with LFS enabled

Glynn Clements glynn at gclements.plus.com
Wed Jan 11 13:47:07 EST 2006


Markus Neteler via RT wrote:

> As (indirectly) suggested, I have added
> #include "config.h"
> 
> to:
> 
> ./raster3d/r3.in.v5d/v5d.c
> ./raster3d/r3.out.v5d/v5d.c
> ./raster/r.thin/io.c
> ./lib/gis/opencell.c
> ./lib/image/rdwr.c
> ./lib/segment/seek.c
> 
> as 'off_t' is used in these files.
> 
> The problem seems to persist, though.

I note that gis.h includes config.h, but it does so after it includes
stdio.h. That may have an impact.

Also, it's possible that some code is assuming that an off_t is the
same size as a long.

I'd suggest that it's likely to be simpler to change the way that
large file support is implemented so that it only applies to source
files which specifically allow for it.

I.e. rather than setting _FILE_OFFSET_BITS in config.h, define a
separate macro (e.g. GRASS_LARGEFILE) and modify specific source files
to do:

	#ifdef GRASS_LARGEFILE
	#define _FILE_OFFSET_BITS 64
	#endif

before including any headers.

The most obvious candidates are the files containing the core raster
I/O code (opencell.c, get_row.c, put_row.c, format.c).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list