Mercurial > p > mysql-python > mysqldb-2
comparison _mysql.h @ 28:5a3e4cafadec MySQLdb
Clean out the old 1.x and 2.2 era memory workarounds (our minimum is 2.3).
Partial application of SF patch 2506449.
author | kylev |
---|---|
date | Sat, 07 Feb 2009 22:48:05 +0000 |
parents | bb552e789992 |
children | fdf0cabb27be |
comparison
equal
deleted
inserted
replaced
27:d301c95d8fd7 | 28:5a3e4cafadec |
---|---|
1 #ifndef _MYSQL_PYTHON__MYSQL_H_ | 1 #ifndef _MYSQL_PYTHON__MYSQL_H_ |
2 #define _MYSQL_PYTHON__MYSQL_H_ | 2 #define _MYSQL_PYTHON__MYSQL_H_ |
3 | 3 |
4 #include "pymemcompat.h" | 4 #include <Python.h> |
5 | 5 |
6 #ifdef MS_WIN32 | 6 #ifdef MS_WIN32 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #endif /* MS_WIN32 */ | 8 #endif /* MS_WIN32 */ |
9 | 9 |
11 #include "mysql.h" | 11 #include "mysql.h" |
12 #include "my_config.h" | 12 #include "my_config.h" |
13 #include "mysqld_error.h" | 13 #include "mysqld_error.h" |
14 #include "errmsg.h" | 14 #include "errmsg.h" |
15 | 15 |
16 #if PY_VERSION_HEX < 0x02020000 | 16 #define MyTuple_Resize(t,n,d) _PyTuple_Resize(t, n) |
17 # define MyTuple_Resize(t,n,d) _PyTuple_Resize(t, n, d) | 17 #define MyMember(a,b,c,d,e) {a,b,c,d,e} |
18 # define MyMember(a,b,c,d,e) {a,b,c,d} | 18 #define MyMemberlist(x) struct PyMemberDef x |
19 # define MyMemberlist(x) struct memberlist x | 19 #define MyAlloc(s,t) (s *) t.tp_alloc(&t,0) |
20 # define MyAlloc(s,t) PyObject_New(s,&t) | 20 #define MyFree(ob) ob->ob_type->tp_free((PyObject *)ob) |
21 # define MyFree(o) PyObject_Del(o) | |
22 #else | |
23 # define MyTuple_Resize(t,n,d) _PyTuple_Resize(t, n) | |
24 # define MyMember(a,b,c,d,e) {a,b,c,d,e} | |
25 # define MyMemberlist(x) struct PyMemberDef x | |
26 # define MyAlloc(s,t) (s *) t.tp_alloc(&t,0) | |
27 # define MyFree(ob) ob->ob_type->tp_free((PyObject *)ob) | |
28 #endif | |
29 | 21 |
30 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) | 22 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) |
31 typedef int Py_ssize_t; | 23 typedef int Py_ssize_t; |
32 #define PY_SSIZE_T_MAX INT_MAX | 24 #define PY_SSIZE_T_MAX INT_MAX |
33 #define PY_SSIZE_T_MIN INT_MIN | 25 #define PY_SSIZE_T_MIN INT_MIN |
75 | 67 |
76 extern PyObject *_mysql_MySQLError; | 68 extern PyObject *_mysql_MySQLError; |
77 extern PyObject *_mysql_Warning; | 69 extern PyObject *_mysql_Warning; |
78 extern PyObject *_mysql_Error; | 70 extern PyObject *_mysql_Error; |
79 extern PyObject *_mysql_DatabaseError; | 71 extern PyObject *_mysql_DatabaseError; |
80 extern PyObject *_mysql_InterfaceError; | 72 extern PyObject *_mysql_InterfaceError; |
81 extern PyObject *_mysql_DataError; | 73 extern PyObject *_mysql_DataError; |
82 extern PyObject *_mysql_OperationalError; | 74 extern PyObject *_mysql_OperationalError; |
83 extern PyObject *_mysql_IntegrityError; | 75 extern PyObject *_mysql_IntegrityError; |
84 extern PyObject *_mysql_InternalError; | 76 extern PyObject *_mysql_InternalError; |
85 extern PyObject *_mysql_ProgrammingError; | 77 extern PyObject *_mysql_ProgrammingError; |
86 extern PyObject *_mysql_NotSupportedError; | 78 extern PyObject *_mysql_NotSupportedError; |
87 extern PyObject *_mysql_error_map; | 79 extern PyObject *_mysql_error_map; |
88 | 80 |
89 extern PyObject * | 81 extern PyObject * |
98 extern int | 90 extern int |
99 _mysql_FieldObject_Initialize( | 91 _mysql_FieldObject_Initialize( |
100 _mysql_FieldObject *self, | 92 _mysql_FieldObject *self, |
101 PyObject *args, | 93 PyObject *args, |
102 PyObject *kwargs); | 94 PyObject *kwargs); |
103 | 95 |
104 #endif | 96 #endif |