mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-18 10:00:31 +03:00
We should now build on ZETA.
This commit is contained in:
parent
a0040160d6
commit
7eda959258
|
@ -1,5 +1,7 @@
|
||||||
2005-10-18 Federico Di Gregorio <fog@initd.org>
|
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.
|
* examples/threads.py: fixed small typo: psycopg -> psycopg2.
|
||||||
|
|
||||||
* Big cleanup of unsigned chars to tame gcc 4.
|
* Big cleanup of unsigned chars to tame gcc 4.
|
||||||
|
|
|
@ -48,10 +48,10 @@ static void Dprintf(const char *fmt, ...) {}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* win32 specific stuff */
|
/* pthreads work-arounds for mutilated operating systems */
|
||||||
#ifndef _WIN32
|
#if defined(_WIN32) || defined(__BEOS__)
|
||||||
#include <pthread.h>
|
|
||||||
#else
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#define pthread_mutex_t HANDLE
|
#define pthread_mutex_t HANDLE
|
||||||
#define pthread_condvar_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);
|
*mutex = CreateMutex(NULL, FALSE, NULL);
|
||||||
return 0;
|
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
|
/* to work around the fact that Windows does not have a gmtime_r function, or
|
||||||
a proper gmtime function */
|
a proper gmtime function */
|
||||||
|
#ifdef _WIN32
|
||||||
static struct tm *gmtime_r(time_t *t, struct tm *tm)
|
static struct tm *gmtime_r(time_t *t, struct tm *tm)
|
||||||
{
|
{
|
||||||
tm = gmtime(t);
|
tm = gmtime(t);
|
||||||
|
|
|
@ -221,7 +221,7 @@ typecast_coerce(PyObject **pv, PyObject **pw)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PyErr_SetString(PyExc_TypeError, "psycopg type coercion failed");
|
PyErr_SetString(PyExc_TypeError, "type coercion failed");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user