summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes2006-08-24 10:48:21 +0000
committerMichael Meskes2006-08-24 10:48:21 +0000
commit8d9cf794375aaebc0e9e111721fe13ef4d2adc96 (patch)
tree877cd286d3a110ba4c6d695cfd90728ef9c50ddf
parente8d1dcbfdeada534b1163d64770a65537c2dd177 (diff)
Needed more stuff from c.h.
-rw-r--r--src/interfaces/ecpg/include/Makefile2
-rw-r--r--src/interfaces/ecpg/include/ecpg_config.h.in3
-rw-r--r--src/interfaces/ecpg/include/pgtypes_interval.h29
3 files changed, 32 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/include/Makefile b/src/interfaces/ecpg/include/Makefile
index 3017aa82d4..4f2c472c59 100644
--- a/src/interfaces/ecpg/include/Makefile
+++ b/src/interfaces/ecpg/include/Makefile
@@ -7,6 +7,8 @@ override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/interfaces/ecpg/include \
informix_esql_dir = $(pkgincludedir)/informix/esql
+all: $(top_builddir)/src/interfaces/ecpg/include/ecpg_config.h
+
install: all installdirs install-headers
.PHONY: install-headers
diff --git a/src/interfaces/ecpg/include/ecpg_config.h.in b/src/interfaces/ecpg/include/ecpg_config.h.in
index b55169deb5..e363cae665 100644
--- a/src/interfaces/ecpg/include/ecpg_config.h.in
+++ b/src/interfaces/ecpg/include/ecpg_config.h.in
@@ -1,3 +1,6 @@
+/* Define to 1 if the system has the type `int64'. */
+#undef HAVE_INT64
+
/* Define to 1 if `long int' works and is 64 bits. */
#undef HAVE_LONG_INT_64
diff --git a/src/interfaces/ecpg/include/pgtypes_interval.h b/src/interfaces/ecpg/include/pgtypes_interval.h
index afde9894fd..ad427c4887 100644
--- a/src/interfaces/ecpg/include/pgtypes_interval.h
+++ b/src/interfaces/ecpg/include/pgtypes_interval.h
@@ -1,14 +1,39 @@
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/include/pgtypes_interval.h,v 1.10 2006/08/23 12:01:52 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/include/pgtypes_interval.h,v 1.11 2006/08/24 10:48:21 meskes Exp $ */
#ifndef PGTYPES_INTERVAL
#define PGTYPES_INTERVAL
#include <ecpg_config.h>
-#if defined(USE_INTEGER_DATETIMES) && (defined(HAVE_LONG_INT_64) || defined(HAVE_LONG_LONG_INT_64))
+#ifndef C_H
+
+#ifdef HAVE_LONG_INT_64
+#ifndef HAVE_INT64
+typedef long int int64;
+#endif
+#elif defined(HAVE_LONG_LONG_INT_64)
+/* We have working support for "long long int", use that */
+
+#ifndef HAVE_INT64
+typedef long long int int64;
+#endif
+#else /* not HAVE_LONG_INT_64 and not
+ * HAVE_LONG_LONG_INT_64 */
+
+/* Won't actually work, but fall back to long int so that code compiles */
+#ifndef HAVE_INT64
+typedef long int int64;
+#endif
+
+#define INT64_IS_BUSTED
+#endif /* not HAVE_LONG_INT_64 and not HAVE_LONG_LONG_INT_64 */
+
+#if defined(USE_INTEGER_DATETIMES) && !defined(INT64_IS_BUSTED)
#define HAVE_INT64_TIMESTAMP
#endif
+#endif /* C_H */
+
typedef struct
{
#ifdef HAVE_INT64_TIMESTAMP