Simon Josefsson <[EMAIL PROTECTED]> writes:

> Bruno Haible <[EMAIL PROTECTED]> writes:
>
>> Elbert Pol wrote:
>>
>>> test-sys_socket.c:27: error: `SHUT_RD' undeclared here (not in a function)
>>> test-sys_socket.c:27: error: initializer element is not constant
>>> test-sys_socket.c:27: error: (near initialization for `a[0]')
>>> test-sys_socket.c:27: error: `SHUT_WR' undeclared here (not in a function)
>>> test-sys_socket.c:27: error: initializer element is not constant
>>> test-sys_socket.c:27: error: (near initialization for `a[1]')
>>> test-sys_socket.c:27: error: `SHUT_RDWR' undeclared here (not in a function)
>>> test-sys_socket.c:27: error: initializer element is not constant
>>> test-sys_socket.c:27: error: (near initialization for `a[2]')
>>
>> Fixing it like this. Simon, do you agree?
>
> Yes.  We have similar workarounds elsewhere in GnuTLS already, but with
> this patch I can remove them and just rely on sys/socket.h.

On second thought; Elbert, does your platform have SD_RECEIVE etc?
There is code in sys_socket.h that does:

/* For shutdown(). */
# if !defined SHUT_RD && defined SD_RECEIVE
#  define SHUT_RD SD_RECEIVE
# endif
# if !defined SHUT_WR && defined SD_SEND
#  define SHUT_WR SD_SEND
# endif
# if !defined SHUT_RDWR && defined SD_BOTH
#  define SHUT_RDWR SD_BOTH
# endif

Using something like that may be cleaner than hard coding the values,
although it is debatable.

/Simon


Reply via email to