diff --git a/CMakeLists.txt b/CMakeLists.txt index bd7295e..4c5c68b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,7 @@ if (ASIO_NET_BUILD_TEST) # for android standalone e.g. termux add_definitions(-DANDROID_STANDALONE) + add_executable(${PROJECT_NAME}_test_version test/version.cpp) add_executable(${PROJECT_NAME}_test_tcp test/tcp.cpp) add_executable(${PROJECT_NAME}_test_tcp_s test/tcp_s.cpp) add_executable(${PROJECT_NAME}_test_tcp_c test/tcp_c.cpp) diff --git a/include/asio_net.hpp b/include/asio_net.hpp index cc97071..4d6684a 100644 --- a/include/asio_net.hpp +++ b/include/asio_net.hpp @@ -1,7 +1,10 @@ #pragma once +#include "asio_net/rpc_client.hpp" +#include "asio_net/rpc_server.hpp" #include "asio_net/server_discovery.hpp" #include "asio_net/tcp_client.hpp" #include "asio_net/tcp_server.hpp" #include "asio_net/udp_client.hpp" #include "asio_net/udp_server.hpp" +#include "asio_net/version.hpp" diff --git a/include/asio_net/config.h b/include/asio_net/config.hpp similarity index 96% rename from include/asio_net/config.h rename to include/asio_net/config.hpp index 19446b0..6949862 100644 --- a/include/asio_net/config.h +++ b/include/asio_net/config.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include namespace asio_net { diff --git a/include/asio_net/detail/tcp_channel_t.hpp b/include/asio_net/detail/tcp_channel_t.hpp index fa6dcf8..df48566 100644 --- a/include/asio_net/detail/tcp_channel_t.hpp +++ b/include/asio_net/detail/tcp_channel_t.hpp @@ -3,7 +3,7 @@ #include #include -#include "../config.h" +#include "../config.hpp" #include "asio.hpp" #include "log.h" #include "message.hpp" diff --git a/include/asio_net/detail/tcp_server_t.hpp b/include/asio_net/detail/tcp_server_t.hpp index f7bd78a..0cb09b3 100644 --- a/include/asio_net/detail/tcp_server_t.hpp +++ b/include/asio_net/detail/tcp_server_t.hpp @@ -2,7 +2,7 @@ #include -#include "../config.h" +#include "../config.hpp" #include "asio.hpp" #include "tcp_channel_t.hpp" diff --git a/include/asio_net/rpc_core b/include/asio_net/rpc_core index 4d51c81..fbd099c 160000 --- a/include/asio_net/rpc_core +++ b/include/asio_net/rpc_core @@ -1 +1 @@ -Subproject commit 4d51c8118ac151ac9619c24a4d364addf92d84db +Subproject commit fbd099c104689aa2d0d683ea0581e323a7e31b41 diff --git a/include/asio_net/version.hpp b/include/asio_net/version.hpp new file mode 100644 index 0000000..86bd09a --- /dev/null +++ b/include/asio_net/version.hpp @@ -0,0 +1,8 @@ +#pragma once + +#define ASIO_NET_VER_MAJOR 2 +#define ASIO_NET_VER_MINOR 0 +#define ASIO_NET_VER_PATCH 0 + +#define ASIO_NET_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch) +#define ASIO_NET_VERSION ASIO_NET_TO_VERSION(ASIO_NET_VER_MAJOR, ASIO_NET_VER_MINOR, ASIO_NET_VER_PATCH) diff --git a/test/version.cpp b/test/version.cpp new file mode 100644 index 0000000..4ee8f7e --- /dev/null +++ b/test/version.cpp @@ -0,0 +1,9 @@ +#include "asio_net.hpp" +#include "log.h" + +int main(int argc, char** argv) { + LOGI("asio: %d", ASIO_VERSION); + LOGI("rpc_core: %d", RPC_CORE_VERSION); + LOGI("asio_net: %d", ASIO_NET_VERSION); + return 0; +}