more dirmod CYGWIN (was: APR 1.0 released)

From: Reini Urban <rurban(at)x-ray(dot)at>
To: pgsql-hackers(at)postgresql(dot)org
Subject: more dirmod CYGWIN (was: APR 1.0 released)
Date: 2004-09-10 10:02:21
Message-ID: 41417BAD.7050402@x-ray.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-hackers-win32 pgsql-patches

[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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-09-10 10:02:58 Re: APR 1.0 released
Previous Message Grant Finnemore 2004-09-10 09:59:11 Re: Failed assertion, CVS head

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Harald Massa 2004-09-10 11:46:08 no connection to server
Previous Message Bruce Momjian 2004-09-10 09:52:22 Re: APR 1.0 released

Browse pgsql-patches by date

  From Date Subject
Next Message Gaetano Mendola 2004-09-10 10:42:12 Re: psql tab-completion improvements
Previous Message Bruce Momjian 2004-09-10 09:52:22 Re: APR 1.0 released