Skip to content

Cast ai_addrlen to to int on _WIN32 #126

@DJm00n

Description

@DJm00n

I have solution configured with warning treated as error on Win32/MSVS2017 and have a warning that prevents me to build:

httplib.h(1755): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data

Please add #ifdef _WIN32 and static_cast<int>(ai.ai_addrlen) here:

if (::bind(sock, ai.ai_addr, ai.ai_addrlen)) {

and here:

auto ret = connect(sock, ai.ai_addr, ai.ai_addrlen);

Also maybe add global namespace prefix :: to be holistic. Maybe in other places too.

Thank you for a good lib.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions