1 /********************************************************
2  Audio Tools, a module and set of tools for manipulating audio data
3  Copyright (C) 2007-2014  Brian Langenberger
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18 *******************************************************/
19 
20 #if PY_MAJOR_VERSION >= 3
21 
22 #define MOD_ERROR_VAL NULL
23 #define MOD_SUCCESS_VAL(val) val
24 #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void)
25 #define MOD_DEF(ob, name, doc, methods) \
26         static struct PyModuleDef moduledef = { \
27             PyModuleDef_HEAD_INIT, name, doc, -1, methods \
28             }; \
29             ob = PyModule_Create(&moduledef);
30 
31 #else
32 
33 #define MOD_ERROR_VAL
34 #define MOD_SUCCESS_VAL(val)
35 #define MOD_INIT(name) PyMODINIT_FUNC init##name(void)
36 #define MOD_DEF(ob, name, doc, methods) \
37         ob = Py_InitModule3(name, methods, doc);
38 
39 #endif
40