summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-12-04 10:26:49 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-12-04 13:51:21 +0000
commit288f9ee80922ef4ae63b463f8c75c9a689dfcc46 (patch)
tree761eae66ec737d42a4bc8baf305437d16ea6156a
parentebd73c14a8b14c8a75345e9bbaf627edaa90da8e (diff)
downloadpsycopg2-288f9ee80922ef4ae63b463f8c75c9a689dfcc46.tar.gz
Work around CentOS 5.5 x86_64 buld problem.
Closes ticket #23
-rw-r--r--ChangeLog3
-rw-r--r--NEWS-2.36
-rw-r--r--psycopg/psycopgmodule.c4
-rw-r--r--psycopg/typecast.c3
-rw-r--r--psycopg/typecast_datetime.c2
-rw-r--r--psycopg/typecast_datetime.h44
-rw-r--r--psycopg/typecast_mxdatetime.c2
-rw-r--r--psycopg/typecast_mxdatetime.h44
8 files changed, 14 insertions, 94 deletions
diff --git a/ChangeLog b/ChangeLog
index 5de3c88..7c16958 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
* setup.py: bumped to version 2.3.1.dev0
+ * datetime modules reorganized to work around CentOS 5.5 x86_64 buld
+ problem. Closes ticket #23
+
2010-12-01 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extras.py: DictRow items can be updated. Patch by Alex Aster.
diff --git a/NEWS-2.3 b/NEWS-2.3
index b0b3c3d..d8208d9 100644
--- a/NEWS-2.3
+++ b/NEWS-2.3
@@ -1,3 +1,9 @@
+What's new in psycopg 2.3.1
+---------------------------
+
+ - Fixed build problem on CentOS 5.5 x86_64 (ticket #23).
+
+
What's new in psycopg 2.3.0
---------------------------
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index d0a7735..db44807 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -48,12 +48,10 @@
#include "psycopg/adapter_asis.h"
#include "psycopg/adapter_list.h"
#include "psycopg/typecast_binary.h"
-#include "psycopg/typecast_datetime.h"
#ifdef HAVE_MXDATETIME
#include <mxDateTime.h>
#include "psycopg/adapter_mxdatetime.h"
-#include "psycopg/typecast_mxdatetime.h"
#endif
/* some module-level variables, like the datetime module */
@@ -764,7 +762,6 @@ init_psycopg(void)
return;
}
if (psyco_adapter_mxdatetime_init()) { return; }
- if (psyco_typecast_mxdatetime_init()) { return; }
#endif
/* import python builtin datetime module, if available */
@@ -778,7 +775,6 @@ init_psycopg(void)
/* Initialize the PyDateTimeAPI everywhere is used */
PyDateTime_IMPORT;
if (psyco_adapter_datetime_init()) { return; }
- if (psyco_typecast_datetime_init()) { return; }
pydatetimeType.ob_type = &PyType_Type;
if (PyType_Ready(&pydatetimeType) == -1) return;
diff --git a/psycopg/typecast.c b/psycopg/typecast.c
index 8eab1eb..2e016cf 100644
--- a/psycopg/typecast.c
+++ b/psycopg/typecast.c
@@ -277,6 +277,7 @@ typecast_init(PyObject *dict)
/* register the date/time typecasters with their original names */
#ifdef HAVE_MXDATETIME
+ if (psyco_typecast_mxdatetime_init()) { return -1; }
for (i = 0; typecast_mxdatetime[i].name != NULL; i++) {
typecastObject *t;
Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name);
@@ -285,6 +286,8 @@ typecast_init(PyObject *dict)
PyDict_SetItem(dict, t->name, (PyObject *)t);
}
#endif
+
+ if (psyco_typecast_datetime_init()) { return -1; }
for (i = 0; typecast_pydatetime[i].name != NULL; i++) {
typecastObject *t;
Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name);
diff --git a/psycopg/typecast_datetime.c b/psycopg/typecast_datetime.c
index 871965b..2bc3625 100644
--- a/psycopg/typecast_datetime.c
+++ b/psycopg/typecast_datetime.c
@@ -26,7 +26,7 @@
#include <math.h>
#include "datetime.h"
-int
+static int
psyco_typecast_datetime_init(void)
{
Dprintf("psyco_typecast_datetime_init: datetime init");
diff --git a/psycopg/typecast_datetime.h b/psycopg/typecast_datetime.h
deleted file mode 100644
index cb01c6f..0000000
--- a/psycopg/typecast_datetime.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* typecast_datetime.h - definitions for datetime objects typecasters
- *
- * Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
- *
- * This file is part of psycopg.
- *
- * psycopg2 is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * In addition, as a special exception, the copyright holders give
- * permission to link this program with the OpenSSL library (or with
- * modified versions of OpenSSL that use the same license as OpenSSL),
- * and distribute linked combinations including the two.
- *
- * You must obey the GNU Lesser General Public License in all respects for
- * all of the code used other than OpenSSL.
- *
- * psycopg2 is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- */
-
-#ifndef PSYCOPG_TYPECAST_DATETIME_H
-#define PSYCOPG_TYPECAST_DATETIME_H 1
-
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
-#include "psycopg/config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HIDDEN int psyco_typecast_datetime_init(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_TYPECAST_DATETIME_H) */
diff --git a/psycopg/typecast_mxdatetime.c b/psycopg/typecast_mxdatetime.c
index a0c8b5b..a3a95fa 100644
--- a/psycopg/typecast_mxdatetime.c
+++ b/psycopg/typecast_mxdatetime.c
@@ -25,7 +25,7 @@
#include "mxDateTime.h"
-int
+static int
psyco_typecast_mxdatetime_init(void)
{
Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime init");
diff --git a/psycopg/typecast_mxdatetime.h b/psycopg/typecast_mxdatetime.h
deleted file mode 100644
index 2c14f81..0000000
--- a/psycopg/typecast_mxdatetime.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* typecast_mxdatetime.h - definitions for mx.DateTime typecasters
- *
- * Copyright (C) 2010 Daniele Varrazzo <daniele.varrazzo@gmail.com>
- *
- * This file is part of psycopg.
- *
- * psycopg2 is free software: you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * In addition, as a special exception, the copyright holders give
- * permission to link this program with the OpenSSL library (or with
- * modified versions of OpenSSL that use the same license as OpenSSL),
- * and distribute linked combinations including the two.
- *
- * You must obey the GNU Lesser General Public License in all respects for
- * all of the code used other than OpenSSL.
- *
- * psycopg2 is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- * License for more details.
- */
-
-#ifndef PSYCOPG_TYPECAST_MXDATETIME_H
-#define PSYCOPG_TYPECAST_MXDATETIME_H 1
-
-#define PY_SSIZE_T_CLEAN
-#include <Python.h>
-
-#include "psycopg/config.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-HIDDEN int psyco_typecast_mxdatetime_init(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !defined(PSYCOPG_TYPECAST_MXDATETIME_H) */