~sircmpwn/public-inbox

wshowkeys: Unbreak build on FreeBSD v1 PROPOSED

Jan Beich
Jan Beich: 1
 Unbreak build on FreeBSD

 1 files changed, 3 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/public-inbox/patches/10091/mbox | git am -3
Learn more about email & git

[PATCH wshowkeys] Unbreak build on FreeBSD Export this patch

Jan Beich
../devmgr.c:33:15: error: implicit declaration of function 'CMSG_SPACE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        char control[CMSG_SPACE(sizeof(*fd_out))] = {0};
                     ^
../devmgr.c:33:15: error: variable-sized object may not be initialized
        char control[CMSG_SPACE(sizeof(*fd_out))] = {0};
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../devmgr.c:49:32: error: use of undeclared identifier 'MSG_CMSG_CLOEXEC'
                ret = recvmsg(sock, &msghdr, MSG_CMSG_CLOEXEC);
                                             ^
../devmgr.c:65:15: error: implicit declaration of function 'CMSG_SPACE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        char control[CMSG_SPACE(sizeof(fd))] = {0};
                     ^
../devmgr.c:65:15: error: variable-sized object may not be initialized
        char control[CMSG_SPACE(sizeof(fd))] = {0};
                     ^~~~~~~~~~~~~~~~~~~~~~
../devmgr.c:82:16: error: implicit declaration of function 'CMSG_LEN' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        .cmsg_len = CMSG_LEN(sizeof(fd)),
                                    ^
---
 devmgr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devmgr.c b/devmgr.c
index 0bd6e05..6700313 100644
--- a/devmgr.c
+++ b/devmgr.c
@@ -4,6 +4,9 @@
 *
 * NOTICE: Most of this code runs as root.
 */
#ifdef __FreeBSD__
#define __BSD_VISIBLE 1
#endif
#include <errno.h>
#include <fcntl.h>
#include <libinput.h>
Thanks!

To git.sr.ht:~sircmpwn/wshowkeys
   a9bf6bc..6388a49  master -> master
View this thread in the archives