changeset 639:7c3671f98280

Update build to work with older versions of gcc (4.6). Also includes some minor cosmetic whitespace changes to the C++ source.
author ronw@google.com
date Tue, 28 May 2013 17:54:18 +0000
parents 6206696d42ac
children d08c02c8e26f
files carfac/SConstruct carfac/agc_params.h carfac/carfac.cc carfac/carfac.h carfac/carfac_output.h carfac/ear.h
diffstat 6 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/carfac/SConstruct	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/SConstruct	Tue May 28 17:54:18 2013 +0000
@@ -40,13 +40,14 @@
   scons --clean
 """
 
+import commands
 import os
 
 carfac_sources = [
     'carfac_common.cc',
     'agc_params.h',
     'agc_coeffs.h',
-    'agc_state.h',		
+    'agc_state.h',
     'carfac_output.cc',
     'car_params.h',
     'car_coeffs.h',
@@ -59,8 +60,12 @@
     ]
 
 env = Environment(CPPPATH=[os.environ['EIGEN_PATH']])
-# Needed to support std::vector initialization lists.
-env.MergeFlags(['-std=c++11'])
+GCC_VERSION = commands.getoutput(env['CXX'] + ' -dumpversion')
+if GCC_VERSION.startswith('4.6'):
+  env.MergeFlags(['-std=c++0x'])
+else:
+  env.MergeFlags(['-std=c++11x'])
+
 env.Library(target = 'carfac', source = carfac_sources)
 
 env.Command('tmp/libgtest.a', [],
--- a/carfac/agc_params.h	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/agc_params.h	Tue May 28 17:54:18 2013 +0000
@@ -52,4 +52,4 @@
   std::vector<FPType> agc2_scales_;
 };
 
-#endif
\ No newline at end of file
+#endif
--- a/carfac/carfac.cc	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/carfac.cc	Tue May 28 17:54:18 2013 +0000
@@ -346,4 +346,4 @@
     previous_stage_gain = agc_coeff.agc_gain_;
     decim = agc_coeff.decim_;
   }
-}
\ No newline at end of file
+}
--- a/carfac/carfac.h	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/carfac.h	Tue May 28 17:54:18 2013 +0000
@@ -78,4 +78,4 @@
   FloatArray pole_freqs_;
 };
 
-#endif
\ No newline at end of file
+#endif
--- a/carfac/carfac_output.h	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/carfac_output.h	Tue May 28 17:54:18 2013 +0000
@@ -46,11 +46,11 @@
              const bool store_bm, const bool store_ohc, const bool store_agc);
   void StoreOutput(const std::vector<Ear>& ears);
   // Here we define several acessors for the data members.
-  const std::deque<std::vector<FloatArray>>& nap() { return nap_;}
+  const std::deque<std::vector<FloatArray>>& nap() { return nap_; }
   const std::deque<std::vector<FloatArray>>& bm() { return bm_; }
-  const std::deque<std::vector<FloatArray>>& nap_decim() { return nap_decim_;}
+  const std::deque<std::vector<FloatArray>>& nap_decim() { return nap_decim_; }
   const std::deque<std::vector<FloatArray>>& ohc() { return ohc_; }
-  const std::deque<std::vector<FloatArray>>& agc() { return agc_;}
+  const std::deque<std::vector<FloatArray>>& agc() { return agc_; }
 
  private:
   int n_ears_;
@@ -66,4 +66,4 @@
   std::deque<std::vector<FloatArray>> agc_;
 };
 
-#endif
\ No newline at end of file
+#endif
--- a/carfac/ear.h	Tue May 28 16:12:07 2013 +0000
+++ b/carfac/ear.h	Tue May 28 17:54:18 2013 +0000
@@ -33,7 +33,7 @@
   // Ear object in the CARFAC 'Design' method.
   void InitEar(const int n_ch, const FPType fs,
                const CARCoeffs& car_params, const IHCCoeffs& ihc_params,
-                 const std::vector<AGCCoeffs>& agc_params);
+               const std::vector<AGCCoeffs>& agc_params);
   // These three methods apply the different stages of the model in sequence
   // to individual audio samples.
   void CARStep(const FPType input);
@@ -99,4 +99,4 @@
   int n_ch_;
 };
 
-#endif
\ No newline at end of file
+#endif