1 /***** Preamble block ********************************************************* 2 * 3 * This file is part of h5py, a Python interface to the HDF5 library. 4 * 5 * http://www.h5py.org 6 * 7 * Copyright 2008-2013 Andrew Collette and contributors 8 * 9 * License: Standard 3-clause BSD; see "license.txt" for full license terms 10 * and contributor agreement. 11 * 12 ****** End preamble block ****************************************************/ 13 14 /* Contains compatibility macros and definitions for use by Cython code */ 15 16 #ifndef H5PY_COMPAT 17 #define H5PY_COMPAT 18 19 #if defined(MPI_VERSION) && (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message) 20 typedef void *PyMPI_MPI_Message; 21 #define MPI_Message PyMPI_MPI_Message 22 #endif 23 24 #include <stddef.h> 25 #include "Python.h" 26 #include "numpy/arrayobject.h" 27 #include "hdf5.h" 28 29 /* The HOFFSET macro can't be used from Cython. */ 30 31 #define h5py_size_n64 (sizeof(npy_complex64)) 32 #define h5py_size_n128 (sizeof(npy_complex128)) 33 34 #ifdef NPY_COMPLEX256 35 #define h5py_size_n256 (sizeof(npy_complex256)) 36 #endif 37 38 #define h5py_offset_n64_real (HOFFSET(npy_complex64, real)) 39 #define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag)) 40 #define h5py_offset_n128_real (HOFFSET(npy_complex128, real)) 41 #define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag)) 42 43 #ifdef NPY_COMPLEX256 44 #define h5py_offset_n256_real (HOFFSET(npy_complex256, real)) 45 #define h5py_offset_n256_imag (HOFFSET(npy_complex256, imag)) 46 #endif 47 48 #endif 49