Re: Pl/perl broken on Windows

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Pl/perl broken on Windows
Дата
Msg-id 200410061635.i96GZKS22225@candle.pha.pa.us
обсуждение исходный текст
Ответ на Pl/perl broken on Windows  ("Dave Page" <dpage@vale-housing.co.uk>)
Список pgsql-hackers
OK, I have adjusted the code to use #define for the plperl compile.
This should prevent the conflict you are getting when perl defines uid_t
too.

---------------------------------------------------------------------------

Dave Page wrote:
> I'm getting the following build failure in pl/perl on Win32. I'm
> guessing this has something to do with the recent rehashing of
> make/include files, but I don't know what exactly. This is on a fresh
> checkout.
>
> Regards, Dave.
>
> make[3]: Entering directory `/cvs/pgsql/src/pl/plperl'
> gcc -O2 -fno-strict-aliasing  -I. -I../../../src/include
> -I./src/include/port/win32 -DEXEC_BACKEND
> "-I../../../src/include/port/win32" -IC:/Perl/lib/CORE  -c -o plperl.o
> plperl.c
> In file included from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32.h:219: conflicting types for `uid_t'
> ../../../src/include/pg_config_os.h:198: previous declaration of `uid_t'
> C:/Perl/lib/CORE/win32.h:220: conflicting types for `gid_t'
> ../../../src/include/pg_config_os.h:199: previous declaration of `gid_t'
> In file included from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32.h:226:1: warning: "isnan" redefined
> In file included from ../../../src/include/utils/timestamp.h:16,
>                  from ../../../src/include/utils/nabstime.h:20,
>                  from ../../../src/include/access/xact.h:20,
>                  from ../../../src/include/utils/tqual.h:19,
>                  from ../../../src/include/access/relscan.h:18,
>                  from ../../../src/include/access/heapam.h:18,
>                  from plperl.c:47:
> c:/mingw/include/math.h:324:1: warning: this is the location of the
> previous definition
> In file included from C:/Perl/lib/CORE/win32.h:549,
>                  from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32iop.h:239:1: warning: "rename" redefined
> In file included from ../../../src/include/c.h:784,
>                  from ../../../src/include/postgres.h:48,
>                  from plperl.c:40:
> ../../../src/include/port.h:177:1: warning: this is the location of the
> previous definition
> In file included from C:/Perl/lib/CORE/win32.h:549,
>                  from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32iop.h:246:1: warning: "open" redefined
> In file included from ../../../src/include/c.h:784,
>                  from ../../../src/include/postgres.h:48,
>                  from plperl.c:40:
> ../../../src/include/port.h:190:1: warning: this is the location of the
> previous definition
> In file included from C:/Perl/lib/CORE/win32.h:549,
>                  from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32iop.h:254:1: warning: "mkdir" redefined
> In file included from ../../../src/include/c.h:85,
>                  from ../../../src/include/postgres.h:48,
>                  from plperl.c:40:
> ../../../src/include/pg_config_os.h:13:1: warning: this is the location
> of the previous definition
> In file included from C:/Perl/lib/CORE/win32.h:549,
>                  from C:/Perl/lib/CORE/win32thread.h:4,
>                  from C:/Perl/lib/CORE/perl.h:2056,
>                  from plperl.c:62:
> C:/Perl/lib/CORE/win32iop.h:304:1: warning: "kill" redefined
> In file included from ../../../src/include/c.h:784,
>                  from ../../../src/include/postgres.h:48,
>                  from plperl.c:40:
> ../../../src/include/port.h:148:1: warning: this is the location of the
> previous definition
> make[3]: *** [plperl.o] Error 1
> make[3]: Leaving directory `/cvs/pgsql/src/pl/plperl'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory `/cvs/pgsql/src/pl'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/cvs/pgsql/src'
> make: *** [all] Error 2
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/include/port/win32.h
===================================================================
RCS file: /cvsroot/pgsql-server/src/include/port/win32.h,v
retrieving revision 1.37
diff -c -c -r1.37 win32.h
*** src/include/port/win32.h    6 Oct 2004 09:35:23 -0000    1.37
--- src/include/port/win32.h    6 Oct 2004 16:31:20 -0000
***************
*** 194,202 ****
--- 194,210 ----

  /*
   * Supplement to <sys/types.h>.
+  *
+  * Perl already has conflicting defines for uid_t and gid_t.
   */
+ #ifndef PLPERL_HAVE_UID_GID
  typedef int uid_t;
  typedef int gid_t;
+ #else
+ /* These are redefined by perl. */
+ #define int uid_t;
+ #define int gid_t;
+ #endif
  typedef long key_t;

  /*
Index: src/pl/plperl/plperl.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/pl/plperl/plperl.c,v
retrieving revision 1.51
diff -c -c -r1.51 plperl.c
*** src/pl/plperl/plperl.c    13 Sep 2004 20:08:59 -0000    1.51
--- src/pl/plperl/plperl.c    6 Oct 2004 16:31:24 -0000
***************
*** 37,42 ****
--- 37,43 ----
   *
   **********************************************************************/

+ #define PLPERL_HAVE_UID_GID
  #include "postgres.h"

  /* system stuff */

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [pgsql-hackers-win32] win32 tablespace handing
Следующее
От: Mark Wong
Дата:
Сообщение: Re: FunctionCall2 performance