00001 00002 /* 00003 00004 freesteam - IAPWS-IF97 steam tables library 00005 Copyright (C) 2004-2005 John Pye 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00020 00021 */ 00022 00023 /* 00024 This file is a hack to make everything compile as normal on MinGW, which has a funny implementation of isnan and isinf 00025 00026 @see 00027 http://www.opensource.apple.com/darwinsource/10.3/libxml2-4/libxml2/include/win32config.h 00028 and http://www.devdaily.com/scw/c/cygwin/src/winsup/mingw/mingwex/math/cbrt.c.shtml 00029 00030 */ 00031 00032 #ifndef ISINFNAN_H 00033 # define ISINFNAN_H 00034 00035 # include "config.h" 00036 00037 # ifdef HAVE_ISNAN 00038 # include <math.h> 00039 # else 00040 00041 # ifdef __MINGW32__ 00042 # include <math.h> 00043 # endif 00044 00045 # if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) 00046 # error "Local 'isnan' implementation only for use with MINGW, Borland and VC++" 00047 # endif 00048 00049 # include <float.h> 00050 00051 # undef isnan 00052 # undef isinf 00053 00054 inline int isnan(const double &x){ 00055 return _isnan(x); 00056 } 00057 00058 inline int isinf(const double &x){ 00059 return _finite(x) ? 0 : 1; 00060 } 00061 00062 # endif 00063 00064 #endif
1.5.6