[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: _GL_EXTERN_INLINE not defined correctly in config.h for macOS

From: Paul Eggert
Subject: Re: _GL_EXTERN_INLINE not defined correctly in config.h for macOS
Date: Mon, 17 Jan 2022 14:14:39 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1

On 1/17/22 10:37, Reuben Thomas wrote:

"extern-inline" copies a stanza of code into
config.h. That code includes a test of the preprocessor macro
"__header_inline". That macro is defined in a system header on macOS.
When config.h is #included, no other header has been included.
Therefore, the symbol will never have been defined at the point where
it is tested in config.h. Therefore, the test will always fail.

Thanks for explaining more. That part of Gnulib was introduced in 2013:


and as I vaguely recall was in response to this macports ticket:


Apparently until now nobody tested that part of Gnulib to make sure that it omits the workaround on newer Apple platforms where the underlying bug has been fixed. (The underlying bug was that <ctype.h> defined static functions to implement isalpha etc. on OS X 10.8 and earlier in C, but the C standard does not allow this and using static functions broke some GNU code.)

Although the workaround still functions on current macOS, it's better to use proper inline functions when available so I installed the attached patch into Gnulib. Please give it a try.

I don't know whether the macOS world has moved on and nobody cares about older Apple releases with the ctype.h bug. If so, we could simplify Gnulib.

Attachment: 0001-extern-inline-improve-macOS-port.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]