Zeugswetter Andreas SB SD writes:
> The problem is, that scan.c includes unistd.h before postgres.h
> and thus unistd.h defines _LARGE_FILE_API which is not allowed
> together with _LARGE_FILES. Do you know an answer ?
> Offhand I can only think of using -D_LARGE_FILES as a compiler flag :-(
That would be pretty tricky to arrange, since the macro that detects all
this is bundled with Autoconf. Also, it would only fix one particular
manifestation of the overall problem, namely that pg_config.h needs to
come first, period.
I can see two ways to fix this properly:
1. Change the flex call to something like
(echo '#include "postgres.h"'; $(FLEX) -t -o$@) >$@
This would throw off all #line references by one.
2. Direct the flex output to another file, say scan2.c, and create a new
scan.c like this:
#include "postgres.h"
#include "scan2.c"
and create the object file from that.
We have half a dozen flex calls in our tree, so either fix would propagate
a great deal of ugliness around.
> Do we really want a general 64 bit off_t or would it be sufficient in the
> two places that use fseeko ?
It affects all the I/O functions. If we want to access large files we
need to use the large-file capable function interface.
--
Peter Eisentraut peter_e@gmx.net