//
// C++-ified by Curtis Olson, started March 2001.
//
-// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
# include <AL/alc.h>
#endif
-#if defined (__APPLE__)
+#if defined (__APPLE__)
// any C++ header file undefines isinf and isnan
// so this should be included before <iostream>
inline int (isinf)(double r) { return isinf(r); }
#define isnan(x) _isnan(x)
#endif
+#if defined (__FreeBSD__)
+inline int isnan(double r) { return !(r < 0 || r > 0); }
+#endif
+
#include STL_IOSTREAM
#include <simgear/debug/logstream.hxx>
// constructor
SGSoundMgr::SGSoundMgr() {
- SG_LOG( SG_GENERAL, SG_ALERT, "Initializing OpenAL sound manager" );
+ SG_LOG( SG_GENERAL, SG_INFO, "Initializing OpenAL sound manager" );
// initialize OpenAL
alutInit( 0, NULL );
- alGetError();
+ atexit(alutExit);
+
if ( alGetError() == AL_NO_ERROR) {
working = true;
} else {
SGSoundSample *sample = sample_current->second;
delete sample;
}
-
- alutExit();
}