|
From: <ho...@us...> - 2004-02-27 02:52:51
|
Update of /cvsroot/ganc/ganc/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2928/src/include Modified Files: defines.h parser.h Log Message: Added considerations about math library that improve portability Index: defines.h =================================================================== RCS file: /cvsroot/ganc/ganc/src/include/defines.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** defines.h 4 Feb 2004 02:54:32 -0000 1.2 --- defines.h 27 Feb 2004 02:44:28 -0000 1.3 *************** *** 2,8 **** --- 2,77 ---- #define __INCLUDED_DEFINES_H__ + + #ifdef HAVE_LONG_DOUBLE_FUNCTIONS + // Basic type for operations in the calculator #define VALUE_TYPE long double + // format string for output + #define FORMAT_STRING "%-15.10Lg\n" + + #define FUN_ABS fabsl + #define FUN_SIN sinl + #define FUN_COS cosl + #define FUN_TAN tanl + #define FUN_ASIN asinl + #define FUN_ACOS acosl + #define FUN_ATAN atanl + #define FUN_SINH sinhl + #define FUN_COSH coshl + #define FUN_TANH tanhl + #define FUN_ASINH asinhl + #define FUN_ACOSH acoshl + #define FUN_ATANH atanhl + #define FUN_EXP expl + #define FUN_LN logl + #define FUN_EXP10 powl + #define FUN_LOG log10l + #define FUN_SQRT sqrtl + #define FUN_FLOOR floorl + #define FUN_CEIL ceill + #define FUN_MOD fmodl + + + #else /* not HAVE_LONG_DOUBLE_FUNCTIONS */ + + // Basic type for operations in the calculator + #define VALUE_TYPE double + + // format string for output + #define FORMAT_STRING "%-15.10g\n" + + #define FUN_ABS fabs + #define FUN_SIN sin + #define FUN_COS cos + #define FUN_TAN tan + #define FUN_ASIN asin + #define FUN_ACOS acos + #define FUN_ATAN atan + #define FUN_SINH sinh + #define FUN_COSH cosh + #define FUN_TANH tanh + #define FUN_ASINH asinh + #define FUN_ACOSH acosh + #define FUN_ATANH atanh + #define FUN_EXP exp + #define FUN_LN log + #define FUN_EXP10 pow + #define FUN_LOG log10 + #define FUN_SQRT sqrt + #define FUN_FLOOR floor + #define FUN_CEIL ceil + #define FUN_MOD fmod + + #endif /* not HAVE_LONG_DOUBLE_FUNCTIONS */ + + + #ifdef HAVE_ISINF + #define ISINF(x) isinf ((x)) + #else /* not HAVE_ISINF */ + #define ISINF(x) 0 + #endif /* not HAVE_ISINF */ + + // definition of infinity, it depens on what VALUE_TYPE is //#define INFINITY HUGE_VALL *************** *** 14,39 **** #define CONSTANT_PI 3.1415926535897932384626433832795029L ! // Definitions to identify functions ! #define FUN_ABS 0 ! #define FUN_SIN 1 ! #define FUN_COS 2 ! #define FUN_TAN 3 ! #define FUN_ASIN 4 ! #define FUN_ACOS 5 ! #define FUN_ATAN 6 ! #define FUN_SINH 7 ! #define FUN_COSH 8 ! #define FUN_TANH 9 ! #define FUN_ASINH 10 ! #define FUN_ACOSH 11 ! #define FUN_ATANH 12 ! #define FUN_EXP 13 ! #define FUN_LN 14 ! #define FUN_EXP10 15 ! #define FUN_LOG 16 ! #define FUN_SQRT 17 ! #define FUN_INT 18 ! #define FUN_FLOOR 19 ! #define FUN_CEIL 20 --- 83,108 ---- #define CONSTANT_PI 3.1415926535897932384626433832795029L ! // ID's of identify functions ! #define FUNID_ABS 0 ! #define FUNID_SIN 1 ! #define FUNID_COS 2 ! #define FUNID_TAN 3 ! #define FUNID_ASIN 4 ! #define FUNID_ACOS 5 ! #define FUNID_ATAN 6 ! #define FUNID_SINH 7 ! #define FUNID_COSH 8 ! #define FUNID_TANH 9 ! #define FUNID_ASINH 10 ! #define FUNID_ACOSH 11 ! #define FUNID_ATANH 12 ! #define FUNID_EXP 13 ! #define FUNID_LN 14 ! #define FUNID_EXP10 15 ! #define FUNID_LOG 16 ! #define FUNID_SQRT 17 ! #define FUNID_INT 18 ! #define FUNID_FLOOR 19 ! #define FUNID_CEIL 20 Index: parser.h =================================================================== RCS file: /cvsroot/ganc/ganc/src/include/parser.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** parser.h 20 Jan 2004 01:33:40 -0000 1.1 --- parser.h 27 Feb 2004 02:44:28 -0000 1.2 *************** *** 6,9 **** --- 6,13 ---- #define __INCLUDED_PARSER_H__ + #ifdef HAVE_CONFIG_H + #include <config.h> + #endif + #include "defines.h" |