Skip to content

Commit

Permalink
Updated socket
Browse files Browse the repository at this point in the history
  • Loading branch information
TracerDS committed Aug 26, 2024
1 parent 1c5cea4 commit e7a895c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
7 changes: 1 addition & 6 deletions include/dpp/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#else
/* Including the library */
#ifdef _WIN32
#include <dpp/win32_safe_warnings.h>
#define DPP_EXPORT __declspec(dllimport)
#else
#define DPP_EXPORT
Expand Down Expand Up @@ -116,11 +115,7 @@ extern bool DPP_EXPORT validate_configuration();

}

#ifndef _WIN32
#ifndef SOCKET
#define SOCKET int
#endif
#else
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
Expand Down
12 changes: 5 additions & 7 deletions include/dpp/socket.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
#pragma once

#ifndef _WIN32
#ifndef SOCKET
#define SOCKET int
#endif
#endif

namespace dpp
{
/**
* @brief Represents a socket file descriptor.
* This is used to ensure parity between windows and unix-like systems.
*/
typedef SOCKET socket;
#ifndef _WIN32
using socket = int;
#else
using socket = SOCKET;
#endif
} // namespace dpp

#ifndef SOCKET_ERROR
Expand Down

0 comments on commit e7a895c

Please sign in to comment.