Skip to content

Commit

Permalink
now working with libuv v1.25.x
Browse files Browse the repository at this point in the history
  • Loading branch information
skypjack committed Jan 24, 2019
1 parent af3d06f commit 27dc68d
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ endif()
# Project configuration
#

project(uvw VERSION 1.12.0)
project(uvw VERSION 1.13.0)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
Expand Down Expand Up @@ -144,6 +144,7 @@ install(
add_custom_target(
uvw_aob
SOURCES
cmake/in/deps.in
appveyor.yml
AUTHORS
LICENSE
Expand Down
2 changes: 1 addition & 1 deletion cmake/in/deps.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ExternalProject_Add(
ExternalProject_Add(
libuv
GIT_REPOSITORY https://github.com/libuv/libuv.git
GIT_TAG v1.24.0
GIT_TAG v1.25.0
SOURCE_DIR @LIBUV_DEPS_DIR@
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down
64 changes: 64 additions & 0 deletions src/uvw/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,55 @@ struct Passwd {
};


/**
* @brief Utility class.
*
* This class can be used to get name and information about the current kernel.
* The populated data includes the operating system name, release, version, and
* machine.
*
* \sa Utilities::uname
*/
struct UName {
UName(std::shared_ptr<uv_utsname_t> utsname): utsname{utsname} {}

/**
* @brief Gets the operating system name (like "Linux").
* @return The operating system name.
*/
std::string sysname() const noexcept {
return utsname ? utsname->sysname : "";
}

/**
* @brief Gets the operating system release (like "2.6.28").
* @return The operating system release.
*/
std::string release() const noexcept {
return utsname ? utsname->release : "";
}

/**
* @brief Gets the operating system version.
* @return The operating system version
*/
std::string version() const noexcept {
return utsname ? utsname->version : "";
}

/**
* @brief Gets the hardware identifier.
* @return The hardware identifier.
*/
std::string machine() const noexcept {
return utsname ? utsname->machine : "";
}

private:
std::shared_ptr<uv_utsname_t> utsname;
};


/**
* @brief The IPv4 tag.
*
Expand Down Expand Up @@ -521,6 +570,21 @@ struct Utilities {
return details::tryRead(&uv_os_gethostname);
}

/**
* @brief Gets name and information about the current kernel.
*
* This function can be used to get name and information about the
* current kernel. The populated data includes the operating system
* name, release, version, and machine.
*
* @return Name and information about the current kernel.
*/
static UName uname() noexcept {
auto ptr = std::make_shared<uv_utsname_t>();
uv_os_uname(ptr.get());
return ptr;
}

/**
* @brief Gets a subset of the password file entry.
*
Expand Down

0 comments on commit 27dc68d

Please sign in to comment.