Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Langage D build on Windows package tinyredis-2.1.1 Error: undefined identifier `EWOULDBLOCK` dmd failed with exit code 1

Tags:

windows

redis

d

dub

I'm trying to build a D project on my Windows machine. It works on mac but I have the following error when building in Windows, I use the command "dub" inside the project and get this at some point :

C:\Users\USER\AppData\Local\dub\packages\tinyredis-2.1.1\tinyredis\source\tinyredis\connection.d(145,30): Error: undefined identifier `EWOULDBLOCK`
dmd failed with exit code 1.      

Any ideas why this EWOULDBLOCK variable is not recognized on Windows ?

Here is the part of connection.d where this identifier appears :

private :

void receive(TcpSocket conn, ref byte[] buffer)
{
    byte[1024 * 16] buff;
    size_t len = conn.receive(buff);

    if (conn.blocking)
    {
        if(len == 0)
            throw new ConnectionException("Server closed the connection!");
        else if(len == TcpSocket.ERROR)
            throw new ConnectionException("A socket error occurred!");
    }
    else
    {
        if (len == -1)
        {
            import core.stdc.errno;

            if (errno == EWOULDBLOCK)
            {
                len = 0;
                errno = 0;
            }
            else
                throw new ConnectionException(format("A socket error occurred! errno: %s", errno));
        }
    }

    buffer ~= buff[0 .. len];
    debug(tinyredis) { writeln("Response : ", "'" ~ escape(cast(string)buffer) ~ "'", " Length : ", len); }
}
like image 310
jakzr Avatar asked Dec 06 '25 05:12

jakzr


1 Answers

It is not a variable, it is a constant.

The simple answer is, it has not been declared.

But looks to be 'required' as per MSDN for compatibility purposes.

The problem is however, while MSVC's libc may support it, DMC's which is the default (-m32) probably won't. Either way this is a bug and should be reported to both the dependency and to D's bug tracker.

like image 194
Richard Andrew Cattermole Avatar answered Dec 08 '25 20:12

Richard Andrew Cattermole