[BTW: there's no need to cc all, I'm subscribed to most lists]

Reini Urban schrieb:
Bruce Momjian schrieb:
Andrew Dunstan wrote:
Reini Urban wrote:

FYI: WIN32 is also defined because <windows.h> is included. (/usr/incluse/w32api/windef.h)
If you want this or that, do proper nesting, and use #else.

Ugh, yes. A little experimentation shows that __WIN32__ is defined for MinGW only, but WIN32 is for both. I wonder how we missed that in various places. Maybe we need a little audit of the use of WIN32.


OK, fixed.  We should not be using __WIN32__, just Win32.  The proper
test is #ifndef __CYGWIN__.


very good. just think of future MSVC versions.

Just one more glitch:

#undef rename
#undef unlink

has to be defined before #include <unistd.h> on CYGWIN, because
unistd.h has the declarations for rename and unlink, which are required inside the pg versions.
without the #undef, the macros which rename rename to pgrename, ... are still effective, which will lead to undeclared/falsely autodeclared rename/unlink parts.


I don't know for mingw, if they need the pgrename/pgunlink declaration.
For my CYGWIN patch I moved those two lines before #include <unistd.h>.

FYI: latest cvs HEAD, without any patches.

make runs now through with the expected implicit declaration warnings, but without any errors. Esp. the CYGWIN-specific SHMLIB linking errors are now gone. good!

make[2]: Entering directory `/usr/src/postgresql/pgsql/src/port'
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations -I../../src/port -I../../src/include -c -o dirmod.o dirmod.c
dirmod.c: In Funktion >>pgunlink<<:
dirmod.c:113: Warnung: implicit declaration of function `unlink'
dirmod.c: In Funktion >>rmt_cleanup<<:
dirmod.c:267: Warnung: implicit declaration of function `pgport_pfree'
dirmod.c: In Funktion >>rmtree<<:
dirmod.c:318: Warnung: implicit declaration of function `pgport_palloc'
dirmod.c:318: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung
dirmod.c:333: Warnung: implicit declaration of function `pgport_pstrdup'
dirmod.c:333: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung


make check hangs at:
"running on port 65432 with pid 2304
============== creating database "regression"         ==============
CREATE DATABASE
ALTER DATABASE
============== dropping regression test user accounts ==============
============== installing PL/pgSQL                    ==============
============== running regression test queries        ==============
parallel group (13 tests):  int2 int4 int8 float4 name varchar numeric"

which means rename works ok. probably the false implicit declarations in the memory code break it.

I'll come with another patch later.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to