
#ifndef _JL_JLLIB_INCLUDE_H_
#define _JL_JLLIB_INCLUDE_H_

#include <math.h>

typedef float real;

#define ABS(x) ((x)<0 ? -(x) : (x))
#define MIN(a,b) ((a)<(b) ? (a) : (b))
#define MAX(a,b) ((a)>(b) ? (a) : (b))

#ifndef fabsf
#define fabsf fabs
#endif

#ifndef fsqrt
#define fsqrt sqrt
#endif

#ifndef asinf
#define asinf asin
#endif

#ifndef acosf
#define acosf acos
#endif

#ifndef fsin
#define fsin sin
#endif

#ifndef sinf
#define sinf sin
#endif

#ifndef cosf
#define cosf cos
#endif

#ifndef fcos
#define fcos cos
#endif

#ifndef ftan
#define ftan tan
#endif

#ifndef tanf
#define tanf tan
#endif

#ifndef fatan
#define fatan atan
#endif

#ifndef logf
#define logf log
#endif

#ifndef expf
#define expf exp
#endif

#ifndef powf
#define powf pow
#endif

#ifndef ffloor
#define ffloor floor
#endif

#ifndef fceil
#define fceil ceil
#endif

#ifndef Matrix
typedef float Matrix[4][4];
#endif


#ifdef JLLIB_IRIX
#define MICRO_SLEEP(x) sginap(x)
#else 
 #ifdef JLLIB_SUN
 #define MICRO_SLEEP(x) sleep(x)
 #else
 #define MICRO_SLEEP(x) usleep(x)
 #endif
#endif


#ifdef JLLIB_LINUX
#ifndef size_t
typedef unsigned int size_t;
#endif
#endif


#endif
