diff options
author | Johan Dahlin <johan@gnome.org> | 2008-07-26 13:23:28 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2008-07-26 13:23:28 +0000 |
commit | e889e0030877bb0b3a7e83f945b8b07230973c01 (patch) | |
tree | d8dd4045f066a3e83dac29435102eeaeb4ad7986 /glib/pyglib-private.h | |
parent | 83627fd48cdd1a39eec874627ef97ed560e231b8 (diff) | |
download | pygobject-e889e0030877bb0b3a7e83f945b8b07230973c01.tar.gz pygobject-e889e0030877bb0b3a7e83f945b8b07230973c01.tar.xz pygobject-e889e0030877bb0b3a7e83f945b8b07230973c01.zip |
Add macros for supporting additional python versions. Start using them for
2008-07-26 Johan Dahlin <johan@gnome.org>
* glib/glibmodule.c (get_handler_priority), (pyglib_idle_add),
(pyglib_timeout_add), (pyglib_timeout_add_seconds),
(pyglib_io_add_watch), (pyglib_child_watch_add),
(pyglib_markup_escape_text), (pyglib_main_depth),
(pyglib_filename_from_utf8), (pyglib_get_application_name),
(pyglib_get_prgname), (PYGLIB_MODULE_START):
* glib/pygiochannel.c (py_io_channel_next),
(py_io_channel_shutdown), (py_io_channel_get_buffer_size),
(py_io_channel_get_buffered), (py_io_channel_get_encoding),
(py_io_channel_read_chars), (py_io_channel_write_chars),
(py_io_channel_write_lines), (py_io_channel_flush),
(py_io_channel_set_flags), (py_io_channel_get_flags),
(py_io_channel_get_buffer_condition), (py_io_channel_win32_poll),
(py_io_channel_read_line), (py_io_channel_read_lines),
(py_io_channel_seek), (pyglib_iochannel_register_types):
* glib/pyglib-private.h:
* glib/pyglib-python-compat.h:
* glib/pyglib.c (pyglib_init), (pyglib_error_check),
(pyglib_gerror_exception_check),
(pyglib_register_exception_for_domain):
Add macros for supporting additional python versions.
Start using them for the glib module. Tested on python 2.5 and 3.0.
svn path=/trunk/; revision=870
Diffstat (limited to 'glib/pyglib-private.h')
-rw-r--r-- | glib/pyglib-private.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/glib/pyglib-private.h b/glib/pyglib-private.h index dd0b2ce..21488b2 100644 --- a/glib/pyglib-private.h +++ b/glib/pyglib-private.h @@ -25,12 +25,9 @@ #include <Python.h> #include <glib.h> -G_BEGIN_DECLS +#include <pyglib-python-compat.h> -/* Compilation on Python 2.4 */ -#if PY_VERSION_HEX < 0x02050000 -typedef int Py_ssize_t; -#endif +G_BEGIN_DECLS struct _PyGLib_Functions { gboolean threads_enabled; @@ -39,16 +36,6 @@ struct _PyGLib_Functions { PyGLibThreadBlockFunc unblock_threads; }; -#define PYGLIB_REGISTER_TYPE(d, type, name) \ - type.ob_type = &PyType_Type; \ - if (!type.tp_alloc) \ - type.tp_alloc = PyType_GenericAlloc; \ - if (!type.tp_new) \ - type.tp_new = PyType_GenericNew; \ - if (PyType_Ready(&type)) \ - return; \ - PyDict_SetItemString(d, name, (PyObject *)&type); - gboolean _pyglib_handler_marshal(gpointer user_data); void _pyglib_destroy_notify(gpointer user_data); |