Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifications for Intel compilers #1117

Merged
merged 2 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ endif()
if (CMAKE_C_COMPILER_ID STREQUAL "Intel")
if (MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qstd=c++11")
else ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fp-model precise")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't set a CMake 3.1 minimum and do this sometime soon (not for this patch, which looks fine IMO)

set (CMAKE_CXX_STANDARD 11)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into this briefly, and it seems that this was brought in after CMake 2.6.0 (the current minimum version at the top of the file)

endif ()
endif ()

Expand Down
6 changes: 3 additions & 3 deletions test/unit/pj_phi2_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ TEST(PjPhi2Test, Basic) {
TEST(PjPhi2Test, AvoidUndefinedBehavior) {
auto ctx = pj_get_default_ctx();

constexpr auto nan = std::numeric_limits<double>::quiet_NaN();
const auto nan = std::numeric_limits<double>::quiet_NaN();
EXPECT_TRUE(std::isnan(pj_phi2(ctx, nan, 0.0)));
EXPECT_TRUE(std::isnan(pj_phi2(ctx, 0.0, nan)));
EXPECT_TRUE(std::isnan(pj_phi2(ctx, nan, nan)));

// We do not really care about the values that follow.
constexpr auto inf = std::numeric_limits<double>::infinity();
const auto inf = std::numeric_limits<double>::infinity();

EXPECT_DOUBLE_EQ(-M_PI_2, pj_phi2(ctx, inf, 0.0));
EXPECT_TRUE(std::isnan(pj_phi2(ctx, 0.0, inf)));
Expand All @@ -82,4 +82,4 @@ TEST(PjPhi2Test, AvoidUndefinedBehavior) {
EXPECT_TRUE(std::isnan(pj_phi2(ctx, -inf, -inf)));
}

} // namespace
} // namespace
4 changes: 2 additions & 2 deletions test/unit/proj_errno_string_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ TEST(ProjErrnoStringTest, ProjErrnos) {
EXPECT_STREQ("invalid projection system error (-1000)", proj_errno_string(-1000));
EXPECT_STREQ("invalid projection system error (-9999)", proj_errno_string(-9999));
// for errnos < -9999, -9999 is always returned
constexpr int min = std::numeric_limits<int>::min();
const int min = std::numeric_limits<int>::min();
EXPECT_STREQ("invalid projection system error (-9999)",proj_errno_string(min));
EXPECT_STREQ("invalid projection system error (-9999)", proj_errno_string(-10000));
}

TEST(ProjErrnoStringTest, SystemErrnos) {
constexpr int max = std::numeric_limits<int>::max();
const int max = std::numeric_limits<int>::max();

#ifdef HAVE_STRERROR
EXPECT_STREQ(strerror(5), proj_errno_string(5));
Expand Down