Thread: ecpg doesn't compile (datetime.h/dtime_t)
Today's cvs doesn't compile. I think it is due to cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h I have dtime_t defined in my sys/types.h. The old version of datetime.h used #define dtime_t timestamp, the new one uses a typedef. Is there actually a reason to keep dtime_t, or would just performing the #define, i.e., the following patch be sufficient? It allows me to compile and install postgres.. (I don't use ecpg, so I really can't say..) Cheers, Patrick
Attachment
On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > Today's cvs doesn't compile. I think it is due to > cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h > I have dtime_t defined in my sys/types.h. The old version of datetime.h used Argh, didn't know that some systems have this datatype. > #define dtime_t timestamp, the new one uses a typedef. Is there actually > a reason to keep dtime_t, or would just performing the #define, i.e., > the following patch be sufficient? It allows me to compile and install > postgres.. (I don't use ecpg, so I really can't say..) For ecpg it does not matter which name you use. The typedef is there for only one reason, namely that Informix uses dtime_t and to be compatible we have to define that type as well. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > Today's cvs doesn't compile. I think it is due to Forgot one question. WHich platform do you use? Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
Michael Meskes wrote: > On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > > Today's cvs doesn't compile. I think it is due to > > cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h > > I have dtime_t defined in my sys/types.h. The old version of datetime.h used > > For ecpg it does not matter which name you use. The typedef is there for > only one reason, namely that Informix uses dtime_t and to be compatible > we have to define that type as well. Should that be visible to non-Informix-compatible builds, or is there no way to control that. -- 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, Pennsylvania19073
On Mon, Sep 29, 2003 at 02:11:37PM -0400, Bruce Momjian wrote: > Should that be visible to non-Informix-compatible builds, or is there > no way to control that. No, it is just defined if you include datetime.h which is supposed to replace Informix file. And the datetime type is only used inside compatlib. Certainly changing the data type there helps building it, but I wonder what we do if anyone on this particular platform tries to use Informix compat mode. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
On Mon, Sep 29, 2003 at 08:08:01PM +0200, Michael Meskes wrote: > On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > > Today's cvs doesn't compile. I think it is due to > > Forgot one question. WHich platform do you use? NetBSD - to quote cvs blame: 1.42 (eeh 30-Dec-99): typedef int32_t dtime_t; /* on-disk time_t */ Cheers, Patrick
On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > Today's cvs doesn't compile. I think it is due to > cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h > I have dtime_t defined in my sys/types.h. The old version of datetime.h used I tried too hide these type definitions from our build process. It should compile now. Michael -- Michael Meskes Email: Michael at Fam-Meskes dot De ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
On Fri, Oct 03, 2003 at 12:59:19PM +0200, Michael Meskes wrote: > On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > > Today's cvs doesn't compile. I think it is due to > > cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h > > I have dtime_t defined in my sys/types.h. The old version of datetime.h used > > I tried too hide these type definitions from our build process. It > should compile now. Now I get: gcc -O2 -pipe -g -Wall -Wmissing-prototypes -Wmissing-declarations -fpic -DPIC -I../../../../src/interfaces/ecpg/include-I../../../../src/include/utils -I../../../../src/include -g -c -o timestamp.otimestamp.c In file included from ../../../../src/interfaces/ecpg/include/compatlib.h:7, from ../../../../src/interfaces/ecpg/include/datetime.h:4, from timestamp.c:14: ../../../../src/interfaces/ecpg/include/ecpglib.h:9:22: libpq-fe.h: No such file or directory In file included from ../../../../src/interfaces/ecpg/include/compatlib.h:7, from ../../../../src/interfaces/ecpg/include/datetime.h:4, from timestamp.c:14: ../../../../src/interfaces/ecpg/include/ecpglib.h:75: error: parse error before "PGresult" ../../../../src/interfaces/ecpg/include/ecpglib.h:79: warning: `enum ECPGttype' declared inside parameter list ../../../../src/interfaces/ecpg/include/ecpglib.h:79: warning: its scope is only this definition or declaration, which isprobably not what you want ../../../../src/interfaces/ecpg/include/ecpglib.h:79: warning: parameter has incomplete type ../../../../src/interfaces/ecpg/include/ecpglib.h:80: warning: `enum ECPGttype' declared inside parameter list ../../../../src/interfaces/ecpg/include/ecpglib.h:80: warning: parameter has incomplete type In file included from timestamp.c:14: ../../../../src/interfaces/ecpg/include/datetime.h:6: error: conflicting types for `dtime_t' /usr/include/sys/types.h:184: error: previous declaration of `dtime_t' gmake[4]: *** [timestamp.o] Error 1 gmake[4]: Leaving directory `/usr/src/local/pgsql/src/interfaces/ecpg/pgtypeslib I did do a gmake distclean beforehand.. % cd src/interfaces/ecpg/include % more datetime.h #ifndef _ECPG_DATETIME_H #define _ECPG_DATETIME_H #include <compatlib.h> typedef timestamp dtime_t; typedef interval intrvl_t; #endif /* ndef _ECPG_DATETIME_H */ % Cheers, Patrick
On Fri, Oct 03, 2003 at 03:00:36PM +0100, Patrick Welche wrote: > On Fri, Oct 03, 2003 at 12:59:19PM +0200, Michael Meskes wrote: > > On Mon, Sep 29, 2003 at 06:41:48PM +0100, Patrick Welche wrote: > > > Today's cvs doesn't compile. I think it is due to > > > cvs diff -r1.7 -r1.8 src/interfaces/ecpg/include/datetime.h > > > I have dtime_t defined in my sys/types.h. The old version of datetime.h used > > > > I tried too hide these type definitions from our build process. It > > should compile now. All fine today.. Patrick