Skip to content

Commit 042a476

Browse files
authored
Merge pull request #58 from offa/compiler_checks_cleanup
Compiler checks cleanup
2 parents 54de807 + 24c390f commit 042a476

File tree

4 files changed

+0
-54
lines changed

4 files changed

+0
-54
lines changed

cmake/CompilerCheck.cmake

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,3 @@ else()
1616
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
1717
endif ()
1818

19-
# atomic
20-
CHECK_INCLUDE_FILE_CXX(atomic HAS_ATOMIC)
21-
if (NOT HAS_ATOMIC)
22-
message(FATAL_ERROR "Seasocks requires a C++ compiler with <atomic>")
23-
endif ()
24-
25-
# override support
26-
file(WRITE ${TEMP_DIR}/TestOverride.cpp
27-
"struct A { virtual ~A() {} virtual void a() {} };\n
28-
struct B : A { void a() override {} };\n
29-
int main() { return 0; }"
30-
)
31-
32-
try_compile(HAVE_OVERRIDE ${TEMP_DIR}
33-
${TEMP_DIR}/TestOverride.cpp
34-
COMPILE_DEFINITIONS
35-
)
36-
37-
if (NOT HAVE_OVERRIDE)
38-
message(FATAL_ERROR "Seasocks requires a C++ compiler with support for 'override'")
39-
endif ()
40-
41-
# emplace support
42-
file(WRITE ${TEMP_DIR}/TestUnorderedMap.cpp
43-
"#include <unordered_map>\n
44-
int main() {
45-
std::unordered_map<int, int> a;
46-
a.emplace(2, 3);
47-
return 0;
48-
}\n"
49-
)
50-
51-
try_compile(HAVE_UNORDERED_MAP_EMPLACE ${TEMP_DIR}
52-
${TEMP_DIR}/TestUnorderedMap.cpp
53-
COMPILE_DEFINITIONS
54-
)
55-
56-
if (HAVE_UNORDERED_MAP_EMPLACE)
57-
set(HAVE_UNORDERED_MAP_EMPLACE 1)
58-
else()
59-
set(HAVE_UNORDERED_MAP_EMPLACE 0)
60-
endif ()

cmake/Config.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
#pragma once
33

4-
/* HAVE_UNORDERED_MAP_EMPLACE */
5-
#cmakedefine HAVE_UNORDERED_MAP_EMPLACE @HAVE_UNORDERED_MAP_EMPLACE@
6-
7-
84
namespace seasocks {
95

106
constexpr auto version = "@PROJECT_VERSION@";

src/main/c/Connection.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,11 +793,7 @@ bool Connection::processHeaders(uint8_t* first, uint8_t* last) {
793793
const char* key = headerLine;
794794
const char* value = skipWhitespace(colonPos + 1);
795795
LS_DEBUG(_logger, "Key: " << key << " || " << value);
796-
#if HAVE_UNORDERED_MAP_EMPLACE
797796
headers.emplace(key, value);
798-
#else
799-
headers.insert(std::make_pair(key, value));
800-
#endif
801797
}
802798

803799
if (headers.count("Connection") && headers.count("Upgrade")

src/test/c/HeaderMapTests.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ using namespace seasocks;
99
namespace {
1010

1111
void emplace(HeaderMap &map, const char *header, const char *value) {
12-
#if HAVE_UNORDERED_MAP_EMPLACE
1312
map.emplace(header, value);
14-
#else
15-
map.insert(std::make_pair(header, value));
16-
#endif
1713
}
1814

1915
TEST_CASE("shouldConstruct", "[HeaderMapTests]") {

0 commit comments

Comments
 (0)