[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: time_rz.c and Android NDK r27
From: |
Po Lu |
Subject: |
Re: time_rz.c and Android NDK r27 |
Date: |
Thu, 05 Sep 2024 09:25:30 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Bruno Haible <bruno@clisp.org> writes:
> Hi Po Lu,
>
>> This new release of the Android NDK defines timezone_t in time.h whether
>> or not it defines the related tzalloc and localtime_rz extensions, which
>> being new APIs are controlled by __ANDROID_API__ as expected.
>> Consequently, when building for earlier Android releases with this NDK,
>> Emacs compilation reports:
>>
>> CC nproc.o
>> CC nstrftime.o
>> In file included from nstrftime.c:19:
>> ./strftime.c:1900:17: error: call to undeclared function 'mktime_z'; ISO C99
>> and later do not support implicit function declarations
>> [-Wimplicit-function-declaration]
>> 1900 | t = mktime_z (tz, <m);
>> | ^
>> ./strftime.c:1900:17: note: did you mean 'mktime'?
>> /opt/android/android-ndk-r27/toolchains/llvm/prebuilt/linux-x86_64/bin/../sysroot/usr/include/time.h:159:8:
>> note: 'mktime' declared here
>> 159 | time_t mktime(struct tm* _Nonnull __tm);
>> | ^
>> 1 error generated.
>
> Thanks for the report. The major mistake we've been doing here is to
> assume that the presence of timezone_t is equivalent to the presence of the
> functions tzalloc, tzfree, localtime_rz, mktime_z.
>
> The following patches should fix it. Tested only on glibc systems and NetBSD.
> If you could test it on Android, with
> CC="clang -target armv7a-unknown-linux-android34"
> and
> CC="clang -target armv7a-unknown-linux-android35"
> that would be welcome!
>
> Bruno
They appear to work very satisfactorily, thanks.