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
Attachments:
thisdifftext/plain; charset=us-asciiDownload
Index: src/interfaces/ecpg/compatlib/informix.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/ecpg/compatlib/informix.c,v
retrieving revision 1.27
diff -u -r1.27 informix.c
--- src/interfaces/ecpg/compatlib/informix.c 22 Sep 2003 13:19:39 -0000 1.27
+++ src/interfaces/ecpg/compatlib/informix.c 29 Sep 2003 17:15:34 -0000
@@ -886,7 +886,7 @@
}
int
-dtcvfmtasc(char *inbuf, char *fmtstr, dtime_t * dtvalue)
+dtcvfmtasc(char *inbuf, char *fmtstr, timestamp * dtvalue)
{
return PGTYPEStimestamp_defmt_asc(inbuf, fmtstr, dtvalue);
}
Index: src/interfaces/ecpg/include/datetime.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/interfaces/ecpg/include/datetime.h,v
retrieving revision 1.8
diff -u -r1.8 datetime.h
--- src/interfaces/ecpg/include/datetime.h 20 Sep 2003 09:10:09 -0000 1.8
+++ src/interfaces/ecpg/include/datetime.h 29 Sep 2003 17:15:34 -0000
@@ -4,15 +4,12 @@
#include <pgtypes_timestamp.h>
#include <pgtypes_interval.h>
-typedef timestamp dtime_t;
-typedef interval intrvl_t;
-
-extern void dtcurrent(dtime_t *);
-extern int dtcvasc(char *, dtime_t *);
-extern int dtsub(dtime_t *, dtime_t *, intrvl_t *);
-extern int dttoasc(dtime_t *, char *);
-extern int dttofmtasc(dtime_t *, char *, int, char *);
-extern int intoasc(intrvl_t *, char *);
-extern int dtcvfmtasc(char *, char *, dtime_t *);
+extern void dtcurrent(timestamp *);
+extern int dtcvasc(char *, timestamp *);
+extern int dtsub(timestamp *, timestamp *, interval *);
+extern int dttoasc(timestamp *, char *);
+extern int dttofmtasc(timestamp *, char *, int, char *);
+extern int intoasc(interval *, char *);
+extern int dtcvfmtasc(char *, char *, timestamp *);
#endif /* ndef _ECPG_DATETIME_H */
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 usedFor 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, Pennsylvania 19073
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 usedI 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.o timestamp.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 is probably 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 usedI tried too hide these type definitions from our build process. It
should compile now.
All fine today..
Patrick