You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/06/20 19:38:53 UTC

[trafficserver] branch 7.1.x updated: Explicit std:: name space, seems to make compiler happy

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/7.1.x by this push:
     new 955fe03  Explicit std:: name space, seems to make compiler happy
955fe03 is described below

commit 955fe032f9d866d39c48989f9651bf7e914c562f
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Mon Mar 13 17:06:31 2017 -0600

    Explicit std:: name space, seems to make compiler happy
    
    This also cleans up the mess around math.h vs cmath on the includes,
    this was necessary to make all platforms and compilers happy.
    
    (cherry picked from commit b91176df357452b8f134bc08e8ea34ddb745353d)
    
     Conflicts:
    	iocore/net/SSLConfig.cc
---
 cmd/traffic_manager/metrics.cc  | 4 +++-
 configure.ac                    | 1 -
 iocore/cache/CacheTest.cc       | 1 +
 iocore/net/SSLConfig.cc         | 1 +
 lib/ts/ink_platform.h           | 4 +---
 proxy/CoreUtils.cc              | 2 +-
 proxy/CoreUtils.h               | 2 --
 proxy/congest/CongestionTest.cc | 1 -
 proxy/logstats.cc               | 2 +-
 tools/jtest/jtest.cc            | 2 +-
 10 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/cmd/traffic_manager/metrics.cc b/cmd/traffic_manager/metrics.cc
index 7186cee..456f163 100644
--- a/cmd/traffic_manager/metrics.cc
+++ b/cmd/traffic_manager/metrics.cc
@@ -21,6 +21,8 @@
  *  limitations under the License.
  */
 
+#include <cmath>
+
 #include "ts/ink_config.h"
 #include "ts/ink_memory.h"
 #include "ts/Ptr.h"
@@ -102,7 +104,7 @@ struct Evaluator {
       case RECD_FLOAT:
         // Lua will eval 0/0 to NaN rather than 0.
         rec_value.rec_float = lua_tonumber(L, -1);
-        if (isnan(rec_value.rec_float)) {
+        if (std::isnan(rec_value.rec_float)) {
           rec_value.rec_float = 0.0;
         }
         break;
diff --git a/configure.ac b/configure.ac
index 9bd59c5..f6adcba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1553,7 +1553,6 @@ AC_CHECK_HEADERS([sys/types.h \
                   stropts.h \
                   sys/param.h \
                   sys/sysmacros.h \
-                  math.h \
                   stdint.h \
                   stdbool.h \
                   sysexits.h \
diff --git a/iocore/cache/CacheTest.cc b/iocore/cache/CacheTest.cc
index 67bf496..3aca888 100644
--- a/iocore/cache/CacheTest.cc
+++ b/iocore/cache/CacheTest.cc
@@ -26,6 +26,7 @@
 #include "P_CacheTest.h"
 #include "api/ts/ts.h"
 #include <vector>
+#include <cmath>
 
 using namespace std;
 
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 4ff970c..0fbe4c2 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -33,6 +33,7 @@
 #include "ts/I_Layout.h"
 
 #include <cstring>
+#include <cmath>
 #include "P_Net.h"
 #include "P_SSLConfig.h"
 #include "P_SSLUtils.h"
diff --git a/lib/ts/ink_platform.h b/lib/ts/ink_platform.h
index db38cb7..95050d6 100644
--- a/lib/ts/ink_platform.h
+++ b/lib/ts/ink_platform.h
@@ -186,9 +186,7 @@ typedef unsigned int in_addr_t;
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
 #endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
+
 #ifdef HAVE_FLOAT_H
 #include <float.h>
 #endif
diff --git a/proxy/CoreUtils.cc b/proxy/CoreUtils.cc
index d092cca..1071138 100644
--- a/proxy/CoreUtils.cc
+++ b/proxy/CoreUtils.cc
@@ -103,7 +103,6 @@ int program_counter = 0;
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <math.h>
 #include "ts/ink_platform.h"
 #include "CoreUtils.h"
 #endif /* darwin || freebsd || solaris */
@@ -112,6 +111,7 @@ int program_counter = 0;
 #include "http/HttpSM.h"
 
 #include <cstdlib>
+#include <cmath>
 
 bool inTable;
 FILE *fp;
diff --git a/proxy/CoreUtils.h b/proxy/CoreUtils.h
index cd7e0da..dd6ed93 100644
--- a/proxy/CoreUtils.h
+++ b/proxy/CoreUtils.h
@@ -37,7 +37,6 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <math.h>
 #include <assert.h>
 #include <elf.h>
 #include "ts/DynArray.h"
@@ -62,7 +61,6 @@ struct core_stack_state {
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
-#include <math.h>
 #include <assert.h>
 
 #define NO_OF_ARGS                                             \
diff --git a/proxy/congest/CongestionTest.cc b/proxy/congest/CongestionTest.cc
index b4ca319..9860604 100644
--- a/proxy/congest/CongestionTest.cc
+++ b/proxy/congest/CongestionTest.cc
@@ -28,7 +28,6 @@
  *
  ****************************************************************************/
 #include "ts/ink_platform.h"
-#include <math.h>
 #include "Main.h"
 #include "CongestionDB.h"
 #include "Congestion.h"
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 54cc262..f2f31c7 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -36,7 +36,6 @@
 #include "LogObject.h"
 #include "hdrs/HTTP.h"
 
-#include <math.h>
 #include <sys/utsname.h>
 #if defined(solaris)
 #include <sys/types.h>
@@ -51,6 +50,7 @@
 #include <algorithm>
 #include <vector>
 #include <list>
+#include <cmath>
 #include <functional>
 #include <fcntl.h>
 #include <unordered_map>
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index ef9bdd0..774a6dd 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -41,9 +41,9 @@
 #include <poll.h>
 #include <netinet/tcp.h>
 #include <sys/resource.h>
-#include <math.h>
 #include <limits.h>
 #include <sys/mman.h>
+#include <cmath>
 
 #include <inttypes.h>
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].