XLALGSL.h

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 
00021 #ifndef XLALGSL_H
00022 #define XLALGSL_H
00023 
00024 #include <gsl/gsl_errno.h>
00025 #include <lal/LALConfig.h>
00026 
00027 #ifdef  __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 NRCSID( XLALGSLH, "$Id: XLALGSL.h,v 1.4 2007/07/07 21:31:20 duncan Exp $" );
00032 
00033 #ifdef LAL_PTHREAD_LOCK
00034 #include <pthread.h>
00035 extern pthread_mutex_t lalGSLPthreadMutex;
00036 #define XLALGSL_PTHREAD_MUTEX_LOCK pthread_mutex_lock( &lalGSLPthreadMutex )
00037 #define XLALGSL_PTHREAD_MUTEX_UNLOCK pthread_mutex_unlock( &lalGSLPthreadMutex )
00038 #else
00039 #define XLALGSL_PTHREAD_MUTEX_LOCK  ((void)(0))
00040 #define XLALGSL_PTHREAD_MUTEX_UNLOCK  ((void)(0))
00041 #endif
00042 
00043 #define XLAL_CALLGSL( statement ) \
00044         do { \
00045           gsl_error_handler_t *saveGSLErrorHandler_; \
00046           XLALGSL_PTHREAD_MUTEX_LOCK; \
00047           saveGSLErrorHandler_ = gsl_set_error_handler_off(); \
00048           statement; \
00049           gsl_set_error_handler( saveGSLErrorHandler_ ); \
00050           XLALGSL_PTHREAD_MUTEX_UNLOCK; \
00051         } while (0)
00052 
00053 
00054 #ifdef  __cplusplus
00055 }
00056 #endif
00057 
00058 #endif /* XLALGSL_H */

Generated on Sat Sep 6 03:07:48 2008 for LAL by  doxygen 1.5.2