1/* ----------------------------------------------------------------------------- 2 * See the LICENSE file for information on copyright, usage and redistribution 3 * of SWIG, and the README file for authors - http://www.swig.org/release.html. 4 * 5 * swigarch.i 6 * 7 * SWIG library file for 32bit/64bit code specialization and checking. 8 * 9 * Use only in extreme cases, when no arch. independent code can be 10 * generated 11 * 12 * To activate architecture specific code, use 13 * 14 * swig -DSWIGWORDSIZE32 15 * 16 * or 17 * 18 * swig -DSWIGWORDSIZE64 19 * 20 * Note that extra checking code will be added to the wrapped code, 21 * which will prevent the compilation in a different architecture. 22 * 23 * If you don't specify the SWIGWORDSIZE (the default case), swig will 24 * generate architecture independent and/or 32bits code, with no extra 25 * checking code added. 26 * ----------------------------------------------------------------------------- */ 27 28#if !defined(SWIGWORDSIZE32) && !defined(SWIGWORDSIZE64) 29# if (__WORDSIZE == 32) 30# define SWIGWORDSIZE32 31# endif 32#endif 33 34#if !defined(SWIGWORDSIZE64) && !defined(SWIGWORDSIZE32) 35# if defined(__x86_64) || defined(__x86_64__) || (__WORDSIZE == 64) 36# define SWIGWORDSIZE64 37# endif 38#endif 39 40 41#ifdef SWIGWORDSIZE32 42%{ 43#define SWIGWORDSIZE32 44#ifndef LONG_MAX 45#include <limits.h> 46#endif 47#if (__WORDSIZE == 64) || (LONG_MAX != INT_MAX) 48# error "SWIG wrapped code invalid in 64 bit architecture, regenarete code using -DSWIGWORDSIZE64" 49#endif 50%} 51#endif 52 53#ifdef SWIGWORDSIZE64 54%{ 55#define SWIGWORDSIZE64 56#ifndef LONG_MAX 57#include <limits.h> 58#endif 59#if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) 60# error "SWIG wrapped code invalid in 32 bit architecture, regenarete code using -DSWIGWORDSIZE32" 61#endif 62%} 63#endif 64 65 66