Commit 9c98803c authored by jan.koester's avatar jan.koester
Browse files

socket compiles now under windows

parent e9bdc4a6
Loading
Loading
Loading
Loading
+4 −1
Changes for src/connection.h: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@
#include <memory>
#include <atomic>
#include <limits>
#include <type_traits>

#include <cstddef>

#pragma once

@@ -77,7 +80,7 @@ namespace netplus {

            // return maximum number of elements that can be allocated
            size_type max_size () const throw() {
                return std::numeric_limits<std::size_t>::max() / sizeof(T);
                return (std::numeric_limits<std::size_t>::max)() / sizeof(T);
            }

            // allocate but don't initialize num elements of type T
+4 −6
Changes for src/socket.h: 4 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -32,12 +32,10 @@

#pragma once

#ifdef Windows
#include <Windows.h>
#endif //Windows

#ifndef SOCKET  
#ifndef Windows  
typedef int SOCKET;
#else
#include <winsock.h>
#endif

namespace netplus {
@@ -73,7 +71,7 @@ namespace netplus {
            int                 _Type;
            void               *_Extension;
#ifdef Windows
            static WSADATA     *_WSAData;
            WSAData            *_WSAData;
#endif // Windows
        };
        
+0 −7
Changes for src/windows/socket.cpp: 0 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -37,17 +37,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "exception.h"
#include "socket.h"
#include "error.h"

#include "config.h"

extern "C" {
    #include <winsock2.h>
};

//#define HIDDEN __attribute__ ((visibility ("hidden")))

WSADATA* netplus::socket::_WSAData = nullptr;


#define WIN32_LEAN_AND_MEAN