os: fix FTBS on Illumos due missing symbols

Several feature defines need to be set before including system headers,
otherwise build breaks:

> /usr/include/X11/Xtrans/Xtranssock.c: In function '_XSERVTransSocketRead':
> /usr/include/X11/Xtrans/Xtranssock.c:2161:14: error: 'struct msghdr' has no member named 'msg_control'
>  2161 |             .msg_control = cmsgbuf.buf,
>       |              ^~~~~~~~~~~
> /usr/include/X11/Xtrans/Xtranssock.c:2162:14: error: 'struct msghdr' has no member named 'msg_controllen'
>  2162 |             .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int))
>       |              ^~~~~~~~~~~~~~
>
> ../os/access.c:339:14: error: implicit declaration of function 'asprintf'; did you mean 'Xasprintf'? [-Werror=implicit-function-declaration]
>   339 |     length = asprintf(addr, "%s%c%s", type, delimiter, value);
>       |              ^~~~~~~~
>       |              Xasprintf

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-06-27 11:52:39 +02:00
parent da7197d5d2
commit 1708c689a8

View File

@ -60,6 +60,13 @@ endif
os_dep = [] os_dep = []
os_c_args = [] os_c_args = []
# eg. struct msghdr -> msg_control
if host_machine.system() == 'sunos'
os_c_args += '-D_XOPEN_SOURCE=1'
os_c_args += '-D_XOPEN_SOURCE_EXTENDED=1'
os_c_args += '-D__EXTENSIONS__'
endif
if get_option('xres') if get_option('xres')
# Only the XRes extension cares about the client ID. # Only the XRes extension cares about the client ID.
os_c_args += '-DCLIENTIDS' os_c_args += '-DCLIENTIDS'