[PATCH libXaw] Add definition of getpagesize(), missing on Windows.

Jon Turney jon.turney at dronecode.org.uk
Sat Mar 9 01:19:33 UTC 2019


On 05/03/2019 17:43, Alan Coopersmith wrote:
> What's wrong with it is mainly that the set of people who know about X 
> libraries
> on Windows is small, and the set of people who deal with libXaw is 
> small, and
> the intersection of those two sets is tiny.   (It also doesn't help that 
> we've
> sucked for years at handling patches by email for the unmaintained 
> modules like
> libXaw - we're trying to get better with gitlab merge requests now, but 
> we're
> still not great - unmaintained modules are still not well maintained.)
> 
> I was hoping one of our Windows folks would comment on whether or not 
> that's the
> right way to handle this, or if there's some Windows header to include 
> instead.
> But if no one pipes up soon, I'll likely just go ahead and push it and 
> see if
> anyone complains afterwards that it broke something.
> 
>      -Alan Coopersmith-               alan.coopersmith at oracle.com
>       Oracle Solaris Engineering - https://blogs.oracle.com/alanc
> 
> On 03/ 4/19 06:54 AM, James Larrowe wrote:
>> Ping. Anything wrong with this? It's only defined in the plugin header 
>> files for gcc.

I guess this means that you're using a MinGW-type Windows-targetted gcc 
and this function is present in libgcc.a (for who knows what historical 
reason...), which is turning on HAVE_GETPAGESIZE?

In that environment, I think there is a unistd.h, which could be 
included to provide a prototype.

Alternatively, since getpagesize() is a POSIX function, and not in the 
Windows API, it's possibly more correct for this code not to be used at 
all on Windows?

James: Going forward, if you'd like to Cc: me on your patches, I will do 
my best to give them review.

>> On Thu, Feb 28, 2019 at 12:56 PM James R Larrowe 
>> <larrowe.semaj11 at gmail.com <mailto:larrowe.semaj11 at gmail.com>> wrote:
>>
>>     Fix build with --enable-selective-werror.
>>
>>     Signed-off-by: James R Larrowe <larrowe.semaj11 at gmail.com
>>     <mailto:larrowe.semaj11 at gmail.com>>
>>     ---
>>       src/OS.c | 3 +++
>>       1 file changed, 3 insertions(+)
>>
>>     diff --git a/src/OS.c b/src/OS.c
>>     index 4c69005..cd0c517 100644
>>     --- a/src/OS.c
>>     +++ b/src/OS.c
>>     @@ -37,6 +37,9 @@ _XawGetPageSize(void)
>>       #endif
>>
>>       #ifdef HAVE_GETPAGESIZE
>>     +# if defined(_WIN32)

Also note that, unfortunately, since _WIN32 is overloaded as meaning 
both "the target is Win32" and "the Win32 API is available", this 
construction can cause difficulties when compiling for the Cygwin target 
if "windows.h" has got included somewhere.

>>     +extern int getpagesize(void);
>>     +# endif
>>           if (pagesize == -1)
>>              pagesize = getpagesize();
>>       #endif
>>     --     2.11.0
>>


More information about the xorg-devel mailing list