Browse Source

fixed three issues related to compiling with Sunstudio

git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@3878 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 14 years ago
parent
commit
f883cfbdc9
2 changed files with 9 additions and 6 deletions
  1. 1 1
      src/lib/dns/masterload.h
  2. 8 5
      src/lib/nsas/random_number_generator.h

+ 1 - 1
src/lib/dns/masterload.h

@@ -40,7 +40,7 @@ public:
 ///
 /// This represents a functor object or a function that takes one parameter
 /// of type \c RRsetPtr and returns nothing.
-typedef boost::function<void(RRsetPtr rrset)> MasterLoadCallback;
+typedef boost::function<void(RRsetPtr)> MasterLoadCallback;
 
 ///
 /// \name Master zone file loader functions.

+ 8 - 5
src/lib/nsas/random_number_generator.h

@@ -139,17 +139,20 @@ private:
 
         double epsilon = 0.0001;
         // The sum must be equal to 1
-        return fabs(sum - 1.0) < epsilon;
+        return std::fabs(sum - 1.0) < epsilon;
     }
 
-    // Shortcut typedefs
-    typedef boost::variate_generator<boost::mt19937&, boost::uniform_real<> > UniformRealGenerator;
-
     std::vector<double> cumulative_;            ///< The partial sum of the probabilities
     boost::mt19937 rng_;                        ///< Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator 
     boost::uniform_real<> dist_;                ///< Uniformly distributed real numbers
+
+    // Shortcut typedef
+    // This typedef is placed directly before its use, as the sunstudio
+    // compiler could not handle it being anywhere else (don't know why)
+    typedef boost::variate_generator<boost::mt19937&, boost::uniform_real<> > UniformRealGenerator;
     UniformRealGenerator uniform_real_gen_;     ///< Uniformly distributed random real numbers generator
-    size_t min_;                                   ///< The minimum integer that will be generated
+
+    size_t min_;                                ///< The minimum integer that will be generated
 };
 
 }   // namespace dns