We should now build on ZETA.

This commit is contained in:
Federico Di Gregorio 2005-10-18 03:57:52 +00:00
parent a0040160d6
commit 7eda959258
3 changed files with 29 additions and 5 deletions

View File

@ -1,5 +1,7 @@
2005-10-18 Federico Di Gregorio <fog@initd.org>
* psycopg/config.h: ZETA config.h patch from Charlie Clark.
* examples/threads.py: fixed small typo: psycopg -> psycopg2.
* Big cleanup of unsigned chars to tame gcc 4.

View File

@ -48,10 +48,10 @@ static void Dprintf(const char *fmt, ...) {}
#endif
#endif
/* win32 specific stuff */
#ifndef _WIN32
#include <pthread.h>
#else
/* pthreads work-arounds for mutilated operating systems */
#if defined(_WIN32) || defined(__BEOS__)
#ifdef _WIN32
#include <winsock2.h>
#define pthread_mutex_t HANDLE
#define pthread_condvar_t HANDLE
@ -64,8 +64,30 @@ static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
*mutex = CreateMutex(NULL, FALSE, NULL);
return 0;
}
#endif /* _WIN32 */
#ifdef __BEOS__
#include <OS.h>
#define pthread_mutex_t sem_id
#define pthread_mutex_lock(object) acquire_sem(object)
#define pthread_mutex_unlock(object) release_sem(object)
#define pthread_mutex_destroy(ref) delete_sem(*ref)
static int pthread_mutex_init(pthread_mutex_t *mutex, void* fake)
{
*mutex = create_sem(1, "psycopg_mutex");
if (*mutex < B_OK)
return *mutex;
return 0;
}
#endif /* __BEOS__ */
#else /* pthread is available */
#include <pthread.h>
#endif
/* to work around the fact that Windows does not have a gmtime_r function, or
a proper gmtime function */
#ifdef _WIN32
static struct tm *gmtime_r(time_t *t, struct tm *tm)
{
tm = gmtime(t);

View File

@ -221,7 +221,7 @@ typecast_coerce(PyObject **pv, PyObject **pw)
return 0;
}
}
PyErr_SetString(PyExc_TypeError, "psycopg type coercion failed");
PyErr_SetString(PyExc_TypeError, "type coercion failed");
return -1;
}