Work around CentOS 5.5 x86_64 buld problem.

Closes ticket #23
This commit is contained in:
Daniele Varrazzo 2010-12-04 10:26:49 +00:00
parent ebd73c14a8
commit 288f9ee809
8 changed files with 14 additions and 94 deletions

View File

@ -2,6 +2,9 @@
* setup.py: bumped to version 2.3.1.dev0 * 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> 2010-12-01 Daniele Varrazzo <daniele.varrazzo@gmail.com>
* lib/extras.py: DictRow items can be updated. Patch by Alex Aster. * lib/extras.py: DictRow items can be updated. Patch by Alex Aster.

View File

@ -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 What's new in psycopg 2.3.0
--------------------------- ---------------------------

View File

@ -48,12 +48,10 @@
#include "psycopg/adapter_asis.h" #include "psycopg/adapter_asis.h"
#include "psycopg/adapter_list.h" #include "psycopg/adapter_list.h"
#include "psycopg/typecast_binary.h" #include "psycopg/typecast_binary.h"
#include "psycopg/typecast_datetime.h"
#ifdef HAVE_MXDATETIME #ifdef HAVE_MXDATETIME
#include <mxDateTime.h> #include <mxDateTime.h>
#include "psycopg/adapter_mxdatetime.h" #include "psycopg/adapter_mxdatetime.h"
#include "psycopg/typecast_mxdatetime.h"
#endif #endif
/* some module-level variables, like the datetime module */ /* some module-level variables, like the datetime module */
@ -764,7 +762,6 @@ init_psycopg(void)
return; return;
} }
if (psyco_adapter_mxdatetime_init()) { return; } if (psyco_adapter_mxdatetime_init()) { return; }
if (psyco_typecast_mxdatetime_init()) { return; }
#endif #endif
/* import python builtin datetime module, if available */ /* import python builtin datetime module, if available */
@ -778,7 +775,6 @@ init_psycopg(void)
/* Initialize the PyDateTimeAPI everywhere is used */ /* Initialize the PyDateTimeAPI everywhere is used */
PyDateTime_IMPORT; PyDateTime_IMPORT;
if (psyco_adapter_datetime_init()) { return; } if (psyco_adapter_datetime_init()) { return; }
if (psyco_typecast_datetime_init()) { return; }
pydatetimeType.ob_type = &PyType_Type; pydatetimeType.ob_type = &PyType_Type;
if (PyType_Ready(&pydatetimeType) == -1) return; if (PyType_Ready(&pydatetimeType) == -1) return;

View File

@ -277,6 +277,7 @@ typecast_init(PyObject *dict)
/* register the date/time typecasters with their original names */ /* register the date/time typecasters with their original names */
#ifdef HAVE_MXDATETIME #ifdef HAVE_MXDATETIME
if (psyco_typecast_mxdatetime_init()) { return -1; }
for (i = 0; typecast_mxdatetime[i].name != NULL; i++) { for (i = 0; typecast_mxdatetime[i].name != NULL; i++) {
typecastObject *t; typecastObject *t;
Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name); Dprintf("typecast_init: initializing %s", typecast_mxdatetime[i].name);
@ -285,6 +286,8 @@ typecast_init(PyObject *dict)
PyDict_SetItem(dict, t->name, (PyObject *)t); PyDict_SetItem(dict, t->name, (PyObject *)t);
} }
#endif #endif
if (psyco_typecast_datetime_init()) { return -1; }
for (i = 0; typecast_pydatetime[i].name != NULL; i++) { for (i = 0; typecast_pydatetime[i].name != NULL; i++) {
typecastObject *t; typecastObject *t;
Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name); Dprintf("typecast_init: initializing %s", typecast_pydatetime[i].name);

View File

@ -26,7 +26,7 @@
#include <math.h> #include <math.h>
#include "datetime.h" #include "datetime.h"
int static int
psyco_typecast_datetime_init(void) psyco_typecast_datetime_init(void)
{ {
Dprintf("psyco_typecast_datetime_init: datetime init"); Dprintf("psyco_typecast_datetime_init: datetime init");

View File

@ -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) */

View File

@ -25,7 +25,7 @@
#include "mxDateTime.h" #include "mxDateTime.h"
int static int
psyco_typecast_mxdatetime_init(void) psyco_typecast_mxdatetime_init(void)
{ {
Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime init"); Dprintf("psyco_typecast_mxdatetime_init: mx.DateTime init");

View File

@ -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) */