~ubuntu-branches/ubuntu/saucy/python-imaging/saucy-proposed

« back to all changes in this revision

Viewing changes to _imagingmath.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "Python.h"
17
17
 
18
18
#include "Imaging.h"
 
19
#include "py3.h"
19
20
 
20
21
#include "math.h"
21
22
#include "float.h"
227
228
    Py_XDECREF(v);
228
229
}
229
230
 
230
 
DL_EXPORT(void)
231
 
init_imagingmath(void)
232
 
{
233
 
    PyObject* m;
234
 
    PyObject* d;
235
 
 
236
 
    m = Py_InitModule("_imagingmath", _functions);
237
 
    d = PyModule_GetDict(m);
 
231
static int
 
232
setup_module(PyObject* m) {
 
233
    PyObject* d = PyModule_GetDict(m);
238
234
 
239
235
    install(d, "abs_I", abs_I);
240
236
    install(d, "neg_I", neg_I);
281
277
    install(d, "gt_F", gt_F);
282
278
    install(d, "ge_F", ge_F);
283
279
 
284
 
}
 
280
    return 0;
 
281
}
 
282
 
 
283
#if PY_VERSION_HEX >= 0x03000000
 
284
PyMODINIT_FUNC
 
285
PyInit__imagingmath(void) {
 
286
    PyObject* m;
 
287
 
 
288
    static PyModuleDef module_def = {
 
289
        PyModuleDef_HEAD_INIT,
 
290
        "_imagingmath",     /* m_name */
 
291
        NULL,               /* m_doc */
 
292
        -1,                 /* m_size */
 
293
        _functions,         /* m_methods */
 
294
    };
 
295
 
 
296
    m = PyModule_Create(&module_def);
 
297
 
 
298
    if (setup_module(m) < 0)
 
299
        return NULL;
 
300
 
 
301
    return m;
 
302
}
 
303
#else
 
304
PyMODINIT_FUNC
 
305
init_imagingmath(void)
 
306
{
 
307
    PyObject* m = Py_InitModule("_imagingmath", _functions);
 
308
    setup_module(m);
 
309
}
 
310
#endif
 
311