~ubuntu-branches/ubuntu/wily/pyzmq/wily

« back to all changes in this revision

Viewing changes to buildutils/initlibzmq.c

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2013-02-24 19:23:15 UTC
  • mfrom: (1.2.1) (9 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: package-import@ubuntu.com-20130224192315-qhmwp3m3ymk8r60d
Tags: 2.2.0.1-1
* New upstream release
* relicense debian packaging to LGPL-3
* update watch file to use github directly
  thanks to Bart Martens for the file
* add autopkgtests
* drop obsolete DM-Upload-Allowed
* bump standard to 3.9.4, no changes required

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
This file is from pyzmq-static by Brandon Craig-Rhodes,
 
3
and used under the BSD license
 
4
 
 
5
py3compat from http://wiki.python.org/moin/PortingExtensionModulesToPy3k
 
6
 
 
7
Provide the init function that Python expects
 
8
when we compile libzmq by pretending it is a Python extension.
 
9
*/
 
10
#include "Python.h"
 
11
 
 
12
static PyMethodDef Methods[] = {
 
13
    {NULL, NULL, 0, NULL}
 
14
};
 
15
 
 
16
#if PY_MAJOR_VERSION >= 3
 
17
 
 
18
static struct PyModuleDef moduledef = {
 
19
        PyModuleDef_HEAD_INIT,
 
20
        "libzmq",
 
21
        NULL,
 
22
        -1,
 
23
        Methods,
 
24
        NULL,
 
25
        NULL,
 
26
        NULL,
 
27
        NULL
 
28
};
 
29
 
 
30
PyMODINIT_FUNC
 
31
PyInit_libzmq(void)
 
32
{
 
33
    PyObject *module = PyModule_Create(&moduledef);
 
34
    return module;
 
35
}
 
36
 
 
37
#else // py2
 
38
 
 
39
PyMODINIT_FUNC
 
40
initlibzmq(void)
 
41
{
 
42
    (void) Py_InitModule("libzmq", Methods);
 
43
}
 
44
 
 
45
#endif