Skip to content

Commit

Permalink
add DPP_EXPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Oct 16, 2024
1 parent 1102998 commit b4a0fa2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/dpp/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace dpp
*
* Avoids type punning with C style casts from sockaddr_in to sockaddr pointers.
*/
class address_t {
class DPP_EXPORT address_t {
/**
* @brief Internal sockaddr struct
*/
Expand All @@ -88,28 +88,28 @@ class address_t {
* @brief Get sockaddr
* @return sockaddr pointer
*/
sockaddr *get_socket_address();
[[nodiscard]] sockaddr *get_socket_address();

/**
* @brief Returns size of sockaddr_in
* @return sockaddr_in size
* @note It is important the size this returns is sizeof(sockaddr_in) not
* sizeof(sockaddr), this is NOT a bug but requirement of C socket functions.
*/
size_t size();
[[nodiscard]] size_t size();

/**
* @brief Get the port bound to a file descriptor
* @param fd File descriptor
* @return Port number, or 0 if no port bound
*/
uint16_t get_port(socket fd);
[[nodiscard]] uint16_t get_port(socket fd);
};

/**
* @brief Allocates a dpp::socket, closing it on destruction
*/
struct raii_socket {
struct DPP_EXPORT raii_socket {
/**
* @brief File descriptor
*/
Expand Down

0 comments on commit b4a0fa2

Please sign in to comment.