+++ /dev/null
-/* sqlitecompat.h - compatibility macros\r
- *\r
- * Copyright (C) 2006-2010 Gerhard Häring <gh@ghaering.de>\r
- *\r
- * This file is part of pysqlite.\r
- *\r
- * This software is provided 'as-is', without any express or implied\r
- * warranty. In no event will the authors be held liable for any damages\r
- * arising from the use of this software.\r
- *\r
- * Permission is granted to anyone to use this software for any purpose,\r
- * including commercial applications, and to alter it and redistribute it\r
- * freely, subject to the following restrictions:\r
- *\r
- * 1. The origin of this software must not be misrepresented; you must not\r
- * claim that you wrote the original software. If you use this software\r
- * in a product, an acknowledgment in the product documentation would be\r
- * appreciated but is not required.\r
- * 2. Altered source versions must be plainly marked as such, and must not be\r
- * misrepresented as being the original software.\r
- * 3. This notice may not be removed or altered from any source distribution.\r
- */\r
-\r
-#include "Python.h"\r
-\r
-#ifndef PYSQLITE_COMPAT_H\r
-#define PYSQLITE_COMPAT_H\r
-\r
-/* define Py_ssize_t for pre-2.5 versions of Python */\r
-\r
-#if PY_VERSION_HEX < 0x02050000\r
-typedef int Py_ssize_t;\r
-typedef int (*lenfunc)(PyObject*);\r
-#endif\r
-\r
-\r
-/* define PyDict_CheckExact for pre-2.4 versions of Python */\r
-#ifndef PyDict_CheckExact\r
-#define PyDict_CheckExact(op) ((op)->ob_type == &PyDict_Type)\r
-#endif\r
-\r
-/* define Py_CLEAR for pre-2.4 versions of Python */\r
-#ifndef Py_CLEAR\r
-#define Py_CLEAR(op) \\r
- do { \\r
- if (op) { \\r
- PyObject *tmp = (PyObject *)(op); \\r
- (op) = NULL; \\r
- Py_DECREF(tmp); \\r
- } \\r
- } while (0)\r
-#endif\r
-\r
-#ifndef PyVarObject_HEAD_INIT\r
-#define PyVarObject_HEAD_INIT(type, size) \\r
- PyObject_HEAD_INIT(type) size,\r
-#endif\r
-\r
-#ifndef Py_TYPE\r
-#define Py_TYPE(ob) ((ob)->ob_type)\r
-#endif\r
-\r
-#endif\r