From 831753b17817e33d06c841be66e48be1b05dba54 Mon Sep 17 00:00:00 2001 From: midipix Date: Aug 03 2019 13:00:07 +0000 Subject: ioctl.h: struct winsize: support both common and arch-specific definition. --- diff --git a/arch/nt32/bits/ioctl.h b/arch/nt32/bits/ioctl.h index 9cbfee7..1bae89b 100644 --- a/arch/nt32/bits/ioctl.h +++ b/arch/nt32/bits/ioctl.h @@ -87,12 +87,12 @@ #define TIOCSER_TEMT 1 -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; +@@@struct winsize { +@@@ unsigned short ws_row; +@@@ unsigned short ws_col; +@@@ unsigned short ws_xpixel; +@@@ unsigned short ws_ypixel; +@@@}; #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/arch/nt64/bits/ioctl.h b/arch/nt64/bits/ioctl.h index 9cbfee7..1bae89b 100644 --- a/arch/nt64/bits/ioctl.h +++ b/arch/nt64/bits/ioctl.h @@ -87,12 +87,12 @@ #define TIOCSER_TEMT 1 -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; +@@@struct winsize { +@@@ unsigned short ws_row; +@@@ unsigned short ws_col; +@@@ unsigned short ws_xpixel; +@@@ unsigned short ws_ypixel; +@@@}; #define TIOCM_LE 0x001 #define TIOCM_DTR 0x002 diff --git a/project/headers.mk b/project/headers.mk index 201188e..af1f57c 100644 --- a/project/headers.mk +++ b/project/headers.mk @@ -105,6 +105,12 @@ build/headers.tag: $(ARCH_HEADERS) touch $@ headers.tag: build/headers.tag $(ARCH_GEN_H) + grep -v '^@@@' build/include/bits/ioctl.h \ + > build/include/bits/ioctl.h.tmp + grep 'struct winsize' $(SOURCE_DIR)/include/sys/ioctl.h \ + || sed 's/^@@@//g' build/include/bits/ioctl.h \ + > build/include/bits/ioctl.h.tmp + mv build/include/bits/ioctl.h.tmp build/include/bits/ioctl.h touch $@ clean-headers: