[PATCH libXaw] Define PAGE_SIZE as USN_PAGE_SIZE on Windows

Jon Turney jon.turney at dronecode.org.uk
Tue Mar 12 20:51:11 UTC 2019


On 09/03/2019 14:45, James R Larrowe wrote:

Thanks for the updated patch.

> Take no action on Cygwin.

I'd like to see some commentary here about why this is needed, e.g.

"Work-around AC_CHECK_FUNCS([getpagesize]) reporting a false positive 
when using MinGW gcc, due to it being present in libgcc.a"

In general, saying something about why a change is needed helps provide 
context when reviewing.

> Signed-off-by: James R Larrowe <larrowe.semaj11 at gmail.com>
> ---
>   src/OS.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/src/OS.c b/src/OS.c
> index 4c69005..bd633c3 100644
> --- a/src/OS.c
> +++ b/src/OS.c
> @@ -17,6 +17,12 @@
>   #define HAS_SC_PAGESIZE	/* _SC_PAGESIZE may be an enum for Linux */
>   #endif
>   
> +#if defined(_WIN32) && !defined(__CYGWIN__)
> +# include <X11/Xwindows.h>
> +# define PAGE_SIZE USN_PAGE_SIZE

Possibly this is technically the wrong value (since it relates to the 
NTFS USN Journal, and not the VM page size)

I'd be just as happy with this if it only did undef HAVE_GETPAGESIZE and 
thus _XawGetPageSize returned 0

I haven't looked at how _XawGetPageSize() is used, and thus what 
difference using the correct page size would make (if any) :)

> +# undef HAVE_GETPAGESIZE
> +#endif
> +
>   int
>   _XawGetPageSize(void)
>   {


More information about the xorg-devel mailing list