[GRASS-dev] winGRASS: debugging vector db issues

Glynn Clements glynn at gclements.plus.com
Sun Feb 25 20:36:18 EST 2007


Moritz Lennert wrote:

> > IIUC, xdr_int() is an internal function of the XDR library, so maybe there
> > are some specificities with the Windows version of this library which we
> > need to take into account ?
> 
> Some more info. I found the following note on the qgis wiki where the code
> of the xdr library comes from
> (http://wiki.qgis.org/qgiswiki/BuildingWindowsBinaryOnLinux):
> 
> "TODO: Use DLL. Currently if DLL is used db drivers do not work because of
> '\n' conversion (text mode expected). Find out how to force xdrlib to
> expect binary mode when compiled as DLL."
> 
> Could this be the cause of our problems ?

EOL issues could be a problem.

AFAICT, each executable has to be linked with $(FMODE_OBJ)
(lib/gis/OBJ.<arch>/fmode.o) to force MSVCRT (open() etc) to operate
in binary mode (the default is to translate LF<->CRLF). Apparently,
this has to go into the executable; putting it into a DLL won't work.

An alternative is to redefine O_RDONLY/O_WRONLY/O_RDWR to include the
O_BINARY flag, e.g.:

	#define	O_RDONLY	(_O_RDONLY | _O_BINARY)
	#define O_WRONLY	(_O_WRONLY | _O_BINARY)
	#define O_RDWR		(_O_RDWR | _O_BINARY)

That won't work with stdin/stdout/stderr, though.

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




More information about the grass-dev mailing list