~ubuntu-branches/ubuntu/precise/dbus-python/precise

« back to all changes in this revision

Viewing changes to _dbus_glib_bindings/module.c

  • Committer: Package Import Robot
  • Author(s): Barry Warsaw
  • Date: 2012-01-12 14:47:33 UTC
  • Revision ID: package-import@ubuntu.com-20120112144733-xtfbmgw30h0j40d2
Tags: 0.84.0-2ubuntu1
* debian/patches:
  - since-0.84.0.patch: Upstream unreleased changes from git tag
    dbus-python-0.84.0 to HEAD.  This is a precursor to the following.
  - python3-support.patch: Upstream unreleased changes from git
    `python3` branch for supporting Python 3. (LP: #893091)
* debian/rules: Enable the test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <dbus/dbus-glib.h>
29
29
#include <dbus/dbus-glib-lowlevel.h>
30
30
 
 
31
#ifdef PY3
 
32
PyMODINIT_FUNC PyInit__dbus_glib_bindings(void);
 
33
#else
31
34
PyMODINIT_FUNC init_dbus_glib_bindings(void);
 
35
#endif
32
36
 
33
37
#if defined(__GNUC__)
34
38
#   if __GNUC__ >= 3
170
174
    {NULL, NULL, 0, NULL}
171
175
};
172
176
 
 
177
#ifdef PY3
 
178
PyMODINIT_FUNC
 
179
PyInit__dbus_glib_bindings(void)
 
180
{
 
181
    PyObject *this_module;
 
182
 
 
183
    static struct PyModuleDef moduledef = {
 
184
        PyModuleDef_HEAD_INIT,
 
185
        "_dbus_glib_bindings",  /* m_name */
 
186
        module_doc,             /* m_doc */
 
187
        -1,                     /* m_size */
 
188
        module_functions,       /* m_methods */
 
189
        NULL,                   /* m_reload */
 
190
        NULL,                   /* m_traverse */
 
191
        NULL,                   /* m_clear */
 
192
        NULL                    /* m_free */
 
193
    };
 
194
 
 
195
    if (import_dbus_bindings("_dbus_glib_bindings") < 0)
 
196
        return NULL;
 
197
 
 
198
    if (!(this_module = PyModule_Create(&moduledef))) {
 
199
        return NULL;
 
200
    }
 
201
    return this_module;
 
202
}
 
203
#else
173
204
PyMODINIT_FUNC
174
205
init_dbus_glib_bindings(void)
175
206
{
180
211
                                  module_doc);
181
212
    if (!this_module) return;
182
213
}
 
214
#endif
183
215
 
184
216
/* vim:set ft=c cino< sw=4 sts=4 et: */