From cd3fb3e33a92697af7330053a5f83cdc9e42f19c Mon Sep 17 00:00:00 2001 From: caremoli Date: Fri, 12 Mar 2010 09:26:11 +0000 Subject: [PATCH] CCAR: add lacking #ifdef WITH_NUMPY in calcium.i for freearg typemaps --- src/DSC/DSC_Python/calcium.i | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/DSC/DSC_Python/calcium.i b/src/DSC/DSC_Python/calcium.i index 215ad0ab4..5f36a91bf 100644 --- a/src/DSC/DSC_Python/calcium.i +++ b/src/DSC/DSC_Python/calcium.i @@ -476,10 +476,12 @@ struct stringArray } } %typemap(freearg) type* IN_ARRAY3 { +%#ifdef WITH_NUMPY if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } +%#endif } %enddef @@ -511,10 +513,12 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) } } %typemap(freearg) float* ecpval { +%#ifdef WITH_NUMPY if (is_new_object$argnum && array$argnum) { Py_DECREF(array$argnum); } +%#endif } /* End of Specific typemap for complex */ @@ -548,6 +552,7 @@ TYPEMAP_IN3(double, PyArray_DOUBLE) } %typemap(freearg) (char** eval,int strSize) { +%#ifdef WITH_NUMPY if (array$argnum) { for(int i=0;i