Re: Building extensions on Windows using VS2008 - Mailing list pgsql-general

From Tom Lane
Subject Re: Building extensions on Windows using VS2008
Date
Msg-id 29143.1298216671@sss.pgh.pa.us
Whole thread Raw
In response to Re: Building extensions on Windows using VS2008  (deepak <deepak.pn@gmail.com>)
List pgsql-general
deepak <deepak.pn@gmail.com> writes:
> Here's the trimmed down version of the source and the Makefile (copied and
> modified from the 'cube' contrib project)
> (with which I see the error related to redefinition)

> /* myext.c */

> #include <string.h>
> #include <math.h>
> #include "postgres.h"
> #include "fmgr.h"

As was noted upthread, this ordering is pretty unsafe.  postgres.h
should always be included *first* in any C file that's meant to run in
the backend environment.  There are platforms in which failing to do so
causes crashes because of 32-vs-64-bit issues.  Not sure if this
explains your Windows issue too, but in any case the above is wrong.

> myext.o: myext.c

> clean:
>     rm -f myext.o

BTW, these rules are unnecessary --- having listed myext.o in OBJS is
sufficient.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Questions about octal vs. hex for bytea
Next
From: Karsten Hilbert
Date:
Subject: Re: problematic view definition