Reorder <complex.h> and <complex> includes

In order to fix the build on gcc-4.8, reorder the <complex.h> include to
always be first, followed by undefinition of the "complex" symbol, and
then finally include the C++ <complex> .
This commit is contained in:
Laurence Withers 2014-07-07 16:53:14 +00:00
parent 5d64e298c3
commit e5e391411f
1 changed files with 6 additions and 3 deletions

View File

@ -5,13 +5,16 @@
* License: GPLv3
*/
#include "iir++.h"
// we need to include "iir.h" first, as it pulls in <complex.h>, which we need
// to take effect before "iir++.h" pulls in <complex>
#include "iir.h"
// iir.h includes <complex.h>, which #defines complex to _Complex. That's fine
// for the C header above, but will mess with our code definitions below.
// now remove the preprocessor definition of complex to _Complex, which is fine
// for the C header but not good for the C++ header
#undef complex
#include "iir++.h"
// Below are all the includes used throughout the library.
namespace IIR {