//
//	Common include file
//
//        Copyright (c) 2002 Jim Peters.  Released under the GNU
//        GPL version 2.  See the file COPYING for details.
//

#define VERSION "0.1.1"
#define PROGNAME "bwview"

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <sys/time.h>
#include <SDL/SDL.h>
#include <math.h>

#ifndef MINGW
#include <sfftw.h>		// Single-precision version of fftw
#include <srfftw.h>		// Single-precision version of fftw
#else
#include <fftw.h>
#include <rfftw.h>
#endif


// I really don't know if this is portable, but it works in GCC both
// with and without optimisation (GCC precompiles it into a constant)
#ifndef NAN
#define NAN (0.0/0.0)
#endif

#ifndef M_PI
#define M_PI           3.14159265358979323846  /* pi */
#endif

#ifndef M_LN10
#define M_LN10         2.30258509299404568402  /* log_e 10 */
#endif

#ifdef MINGW
#define isnan(val) _isnan(val)
#endif

#include "file.h"
#include "analysis.h"
#include "config.h"

#include "proto.h"

#define DEBUG_ON 1
#define DEBUG if (DEBUG_ON) warn
#define ALLOC(type) ((type*)Alloc(sizeof(type)))
#define ALLOC_ARR(cnt, type) ((type*)Alloc((cnt) * sizeof(type)))

// END //

