--- parser3/src/include/pa_config_includes.h 2003/02/03 15:57:43 1.23.2.2 +++ parser3/src/include/pa_config_includes.h 2003/11/06 14:25:25 1.26 @@ -8,6 +8,9 @@ fixed otherwise. */ +#ifndef PA_CONFIG_INCLUDES_H +#define PA_CONFIG_INCLUDES_H + #if _MSC_VER # pragma warning(disable:4291) // disable warning // "no matching operator delete found; memory will not be freed if initialization throws an exception @@ -23,6 +26,10 @@ # undef inline #endif +#ifdef HAVE_ASSERT_H +# include +#endif + #ifdef HAVE_CTYPE_H # include #endif @@ -67,9 +74,7 @@ # include #endif -#ifdef HAVE_STDLIB_H -# include -#endif +#include #ifdef HAVE_STRING_H # include @@ -114,7 +119,7 @@ #ifdef HAVE_SYS_SOCKET_H # include #else -# ifdef HAVE_WINSOCK_H +# if defined(HAVE_WINSOCK_H) && !defined(_MSC_VER) && !defined(CYGWIN) # include # endif #endif @@ -145,3 +150,29 @@ #endif +// math function replacements + +#ifdef __cplusplus + +#ifndef HAVE_TRUNC +inline double trunc(double param) { return param > 0? floor(param) : ceil(param); } +#endif + +#ifndef HAVE_ROUND +inline double round(double param) { return floor(param+0.5); } +#endif + +#ifndef HAVE_SIGN +inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } +#endif + +#if !defined(max) +inline int max(int a, int b) { return a>b?a:b; } +inline int min(int a, int b){ return ab?a:b; } +inline size_t min(size_t a, size_t b){ return a