Skip to content

Commit af90a24

Browse files
committed
Tidy up
1 parent b343ff9 commit af90a24

File tree

83 files changed

+769
-2161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+769
-2161
lines changed

3rdparty/CMakeLists.txt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ function(ax_add_3rd source_dir)
119119
set_target_properties(${tgt} PROPERTIES
120120
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
121121
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
122-
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
122+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
123123
FOLDER "3rdparty"
124124
)
125-
else()
125+
else()
126126
set_target_properties(${tgt} PROPERTIES
127127
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
128-
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
128+
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
129129
FOLDER "3rdparty"
130130
)
131131
endif()
@@ -383,6 +383,11 @@ if(AX_WITH_LZ4)
383383
)
384384
endif()
385385

386+
if(AX_ENABLE_MEMORY_TRACKER)
387+
_1kfetch(minhook)
388+
ax_add_3rd(${minhook_SOURCE_DIR} NO_LINK TARGETS minhook)
389+
endif()
390+
386391
if(AX_WITH_DOCTEST)
387392
ax_add_3rd(doctest NO_LINK)
388393
endif()

3rdparty/yasio/yasio/array_buffer.hpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

3rdparty/yasio/yasio/bindings/yasio_sol.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,33 @@ SOFTWARE.
3131
# include "sol2/sol.hpp" // sol2-2.x
3232
#endif
3333

34-
// use cxx17::string_view workaround with std::string_view
34+
// use std::string_view workaround with std::string_view
3535
#if !YASIO__HAS_CXX17
3636
namespace sol
3737
{
3838
namespace stack
3939
{
4040
template <>
41-
struct pusher<cxx17::string_view> {
42-
static int push(lua_State* L, const cxx17::string_view& str)
41+
struct pusher<std::string_view> {
42+
static int push(lua_State* L, const std::string_view& str)
4343
{
4444
lua_pushlstring(L, !str.empty() ? str.c_str() : "", str.length());
4545
return 1;
4646
}
4747
};
4848
template <>
49-
struct getter<cxx17::string_view> {
50-
static cxx17::string_view get(lua_State* L, int index, record& tracking)
49+
struct getter<std::string_view> {
50+
static std::string_view get(lua_State* L, int index, record& tracking)
5151
{
5252
tracking.use(1); // THIS IS THE ONLY BIT THAT CHANGES
5353
size_t len = 0;
5454
const char* s = lua_tolstring(L, index, &len);
55-
return cxx17::string_view(s, len);
55+
return std::string_view(s, len);
5656
}
5757
};
5858
} // namespace stack
5959
template <>
60-
struct lua_type_of<cxx17::string_view> : std::integral_constant<type, type::string> {};
60+
struct lua_type_of<std::string_view> : std::integral_constant<type, type::string> {};
6161
} // namespace sol
6262
#endif
6363

3rdparty/yasio/yasio/compiler/feature_test.hpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,7 @@ SOFTWARE.
259259

260260
#define YASIO__STD ::std::
261261

262-
#if YASIO__HAS_CXX14
263-
namespace cxx14
264-
{
265-
using namespace std;
266-
};
267-
#endif
268-
269-
#if YASIO__HAS_CXX17
270-
namespace cxx17
271-
{
272-
using namespace std;
273-
};
274-
#endif
262+
// The yasio is the original tlx provider
263+
#define _TLX ::tlx::
275264

276265
#endif

3rdparty/yasio/yasio/ibstream.hpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class binary_reader_impl {
123123
using convert_traits_type = _Traits;
124124
using this_type = binary_reader_impl<_Traits>;
125125
binary_reader_impl() { this->reset("", 0); }
126-
binary_reader_impl(const sbyte_buffer& d) { this->reset(d); }
127-
binary_reader_impl(const cxx17::string_view& d) { this->reset(d); }
126+
binary_reader_impl(const tlx::sbyte_buffer& d) { this->reset(d); }
127+
binary_reader_impl(const std::string_view& d) { this->reset(d); }
128128
binary_reader_impl(const void* data, size_t size) { this->reset(data, size); }
129129
template <typename _BufferType>
130130
binary_reader_impl(const binary_writer_impl<_Traits, _BufferType>* obs)
@@ -143,8 +143,8 @@ class binary_reader_impl {
143143

144144
~binary_reader_impl() {}
145145

146-
void reset(const sbyte_buffer& d) { reset(d.data(), d.size()); }
147-
void reset(const cxx17::string_view& d) { reset(d.data(), d.length()); }
146+
void reset(const tlx::sbyte_buffer& d) { reset(d.data(), d.size()); }
147+
void reset(const std::string_view& d) { reset(d.data(), d.length()); }
148148
void reset(const void* data, size_t size)
149149
{
150150
first_ = ptr_ = static_cast<const char*>(data);
@@ -165,15 +165,15 @@ class binary_reader_impl {
165165

166166
int read_varint(int size)
167167
{
168-
size = yasio::clamp(size, 1, YASIO_SSIZEOF(int));
168+
size = std::clamp(size, 1, YASIO_SSIZEOF(int));
169169

170170
int value = 0;
171171
::memcpy(&value, consume(size), size);
172172
return convert_traits_type::fromint(value, size);
173173
}
174174

175175
/* read blob data with '7bit encoded int' length field */
176-
cxx17::string_view read_v()
176+
std::string_view read_v()
177177
{
178178
int count = read_ix<int>();
179179
return read_bytes(count);
@@ -210,15 +210,15 @@ class binary_reader_impl {
210210
::memcpy(oav, consume(len), len);
211211
}
212212

213-
cxx17::string_view read_v32() { return read_v_fx<uint32_t>(); }
214-
cxx17::string_view read_v16() { return read_v_fx<uint16_t>(); }
215-
cxx17::string_view read_v8() { return read_v_fx<uint8_t>(); }
213+
std::string_view read_v32() { return read_v_fx<uint32_t>(); }
214+
std::string_view read_v16() { return read_v_fx<uint16_t>(); }
215+
std::string_view read_v8() { return read_v_fx<uint8_t>(); }
216216

217-
cxx17::string_view read_bytes(int len)
217+
std::string_view read_bytes(int len)
218218
{
219219
if (len > 0)
220-
return cxx17::string_view(consume(len), len);
221-
return cxx17::string_view{};
220+
return std::string_view(consume(len), len);
221+
return std::string_view{};
222222
}
223223

224224
bool empty() const { return first_ == last_; }
@@ -264,19 +264,19 @@ class binary_reader_impl {
264264
}
265265

266266
template <typename _LenT>
267-
inline cxx17::string_view read_v_fx()
267+
inline std::string_view read_v_fx()
268268
{
269269
_LenT n = this->read<_LenT>();
270270
if (n > 0)
271271
return read_bytes(n);
272272
return {};
273273
}
274274

275-
cxx17::string_view range_view(size_t start, size_t end)
275+
std::string_view range_view(size_t start, size_t end)
276276
{
277277
if (start <= end && (first_ + end) <= last_)
278-
return cxx17::string_view{first_ + start, end - start};
279-
return cxx17::string_view{};
278+
return std::string_view{first_ + start, end - start};
279+
return std::string_view{};
280280
}
281281

282282
bool eof() const { return ptr_ == last_; }
@@ -305,7 +305,7 @@ template <typename _Traits>
305305
class basic_ibstream : public binary_reader_impl<_Traits> {
306306
public:
307307
basic_ibstream() {}
308-
basic_ibstream(sbyte_buffer blob) : binary_reader_impl<_Traits>(), blob_(std::move(blob)) { this->reset(blob_.data(), static_cast<int>(blob_.size())); }
308+
basic_ibstream(tlx::sbyte_buffer blob) : binary_reader_impl<_Traits>(), blob_(std::move(blob)) { this->reset(blob_.data(), static_cast<int>(blob_.size())); }
309309
basic_ibstream(const basic_obstream<_Traits>* obs) : binary_reader_impl<_Traits>(), blob_(obs->buffer())
310310
{
311311
this->reset(blob_.data(), static_cast<int>(blob_.size()));
@@ -332,7 +332,7 @@ class basic_ibstream : public binary_reader_impl<_Traits> {
332332
}
333333

334334
protected:
335-
sbyte_buffer blob_;
335+
tlx::sbyte_buffer blob_;
336336
};
337337

338338
using ibstream_view = binary_reader_impl<convert_traits<network_convert_tag>>;

3rdparty/yasio/yasio/impl/mbedtls.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ YASIO__DECL yssl_ctx_st* yssl_ctx_new(const yssl_options& opts)
5151
YASIO_LOG("mbedtls_ssl_config_defaults fail with ret=%d", ret);
5252

5353
// rgn engine
54-
cxx17::string_view pers = opts.client ? cxx17::string_view{YASIO_SSL_PIN, YASIO_SSL_PIN_LEN} : cxx17::string_view{YASIO_SSL_PON, YASIO_SSL_PON_LEN};
54+
std::string_view pers = opts.client ? std::string_view{YASIO_SSL_PIN, YASIO_SSL_PIN_LEN} : std::string_view{YASIO_SSL_PON, YASIO_SSL_PON_LEN};
5555
ret = ::mbedtls_ctr_drbg_seed(&ctx->ctr_drbg, ::mbedtls_entropy_func, &ctx->entropy, (const unsigned char*)pers.data(), pers.length());
5656
if (ret != 0)
5757
{

3rdparty/yasio/yasio/impl/poll_io_watcher.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Copyright (c) 2012-2025 HALX99 (halx99 at live dot com)
77
#ifndef YASIO__POLL_IO_WATCHER_HPP
88
#define YASIO__POLL_IO_WATCHER_HPP
9-
#include "yasio/vector.hpp"
9+
#include "yasio/tlx/vector.hpp"
1010
#include "yasio/impl/socket.hpp"
1111
#include "yasio/impl/select_interrupter.hpp"
1212

@@ -77,7 +77,7 @@ class poll_io_watcher {
7777
}
7878
return underlying_events;
7979
}
80-
static void pollfd_mod(yasio::vector<pollfd>& fdset, socket_native_type fd, int add_events, int remove_events)
80+
static void pollfd_mod(tlx::vector<pollfd>& fdset, socket_native_type fd, int add_events, int remove_events)
8181
{
8282
auto it = std::find_if(fdset.begin(), fdset.end(), [fd](const pollfd& pfd) { return pfd.fd == fd; });
8383
if (it != fdset.end())
@@ -96,8 +96,8 @@ class poll_io_watcher {
9696
}
9797

9898
protected:
99-
yasio::vector<pollfd> events_;
100-
yasio::vector<pollfd> revents_;
99+
tlx::vector<pollfd> events_;
100+
tlx::vector<pollfd> revents_;
101101

102102
select_interrupter interrupter_;
103103
};

0 commit comments

Comments
 (0)