File tree Expand file tree Collapse file tree 5 files changed +40
-17
lines changed Expand file tree Collapse file tree 5 files changed +40
-17
lines changed Original file line number Diff line number Diff line change 1
- os :
2
- - linux
3
- - osx
4
-
5
- osx_image : xcode10.1
1
+ matrix :
2
+ include :
3
+ - os : linux
4
+ dist : xenial
5
+ - os : osx
6
+ osx_image : xcode11
6
7
7
8
sudo : required
8
9
9
- dist : xenial
10
-
11
10
language : cpp
12
11
13
12
addons :
@@ -20,13 +19,14 @@ addons:
20
19
- libssl-dev
21
20
- build-essential
22
21
- cmake
22
+ - libgtest-dev
23
+ - libc-ares-dev
23
24
homebrew :
24
25
packages :
25
26
- openssl
26
27
- cmake
27
28
- libtool
29
+ - gtest
28
30
29
31
script :
30
- - ./build.sh
31
-
32
-
32
+ - ./build.sh -t
Original file line number Diff line number Diff line change @@ -84,15 +84,15 @@ set_property(TARGET trantor PROPERTY CXX_STANDARD 14)
84
84
set_property (TARGET trantor PROPERTY CXX_STANDARD_REQUIRED ON )
85
85
set_property (TARGET trantor PROPERTY CXX_EXTENSIONS OFF )
86
86
87
- if (MAKETEST STREQUAL YES )
87
+ if (MAKETEST STREQUAL YES )
88
88
add_subdirectory (trantor/tests )
89
89
find_package (GTest )
90
90
if (GTest_FOUND )
91
91
include_directories (${GTEST_INCLUDE_DIRS} )
92
92
link_libraries (${GTEST_LIBRARIES} )
93
93
add_subdirectory (trantor/unittests )
94
94
endif ()
95
- endif ()
95
+ endif ()
96
96
97
97
set (public_net_headers
98
98
trantor/net/EventLoop.h
Original file line number Diff line number Diff line change @@ -20,8 +20,12 @@ function build_trantor() {
20
20
echo " Entering folder: ${build_dir} "
21
21
cd $build_dir
22
22
23
- echo " Start building drogon ..."
24
- cmake ..
23
+ echo " Start building trantor ..."
24
+ if [ $1 -eq 1 ]; then
25
+ cmake .. -DMAKETEST=YES
26
+ else
27
+ cmake ..
28
+ fi
25
29
26
30
# If errors then exit
27
31
if [ " $? " != " 0" ]; then
@@ -44,4 +48,8 @@ function build_trantor() {
44
48
# Ok!
45
49
}
46
50
47
- build_trantor
51
+ if [ " $1 " = " -t" ]; then
52
+ build_trantor 1
53
+ else
54
+ build_trantor 0
55
+ fi
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ void MsgBuffer::ensureWritableBytes(size_t len)
87
87
newbuffer.append (*this );
88
88
swap (newbuffer);
89
89
}
90
- void MsgBuffer::swap (MsgBuffer &buf)
90
+ void MsgBuffer::swap (MsgBuffer &buf) noexcept
91
91
{
92
92
_buffer.swap (buf._buffer );
93
93
std::swap (_head, buf._head );
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ class MsgBuffer
65
65
uint16_t readInt16 ();
66
66
uint32_t readInt32 ();
67
67
uint64_t readInt64 ();
68
- void swap (MsgBuffer &buf);
68
+ void swap (MsgBuffer &buf) noexcept ;
69
69
size_t readableBytes () const
70
70
{
71
71
return _tail - _head;
@@ -167,4 +167,19 @@ class MsgBuffer
167
167
return &_buffer[0 ];
168
168
}
169
169
};
170
+
171
+ inline void swap (MsgBuffer &one, MsgBuffer &two) noexcept
172
+ {
173
+ one.swap (two);
174
+ }
170
175
} // namespace trantor
176
+
177
+ namespace std
178
+ {
179
+ template <>
180
+ inline void swap<trantor::MsgBuffer>(trantor::MsgBuffer &one,
181
+ trantor::MsgBuffer &two) noexcept
182
+ {
183
+ one.swap (two);
184
+ }
185
+ } // namespace std
You can’t perform that action at this time.
0 commit comments