summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <mh+mozilla@glandium.org>2022-08-30 09:39:25 +0000
committerMike Hommey <mh+mozilla@glandium.org>2022-08-30 09:39:25 +0000
commit4f39d8167e9a5b9270d777bb932353e8e0724c9f (patch)
tree8cc26ae73374e91dae6f1134abbea76a57eab27f
parent2319e380b4cc00ebcbe5e9e0de5687a25772f994 (diff)
downloadnspr-hg-4f39d8167e9a5b9270d777bb932353e8e0724c9f.tar.gz
Bug 1784193 - Cast values when setting _md_iovector._{f,}stat64 on Android API < 21. r=kaie
Android API < 21 didn't have fstat64 or stat64 definitions, but it did have definitions for `struct stat64` that, while being a separate struct, is identical to `struct stat`. The signature for fstat and stat are thus valid, but the compiler can't say. Clang recently added a warning for incompatible function pointers, and it trips on using fstat and stat because of this. Differential Revision: https://phabricator.services.mozilla.com/D154336
-rw-r--r--pr/src/md/unix/unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c
index f71d1f66..70bb8e87 100644
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -2755,8 +2755,8 @@ static void _PR_InitIOV(void)
_md_iovector._mmap64 = mmap64;
#if (defined(ANDROID) && __ANDROID_API__ < 21)
/* Same as the open64 case for Android. */
- _md_iovector._fstat64 = fstat;
- _md_iovector._stat64 = stat;
+ _md_iovector._fstat64 = (_MD_Fstat64)fstat;
+ _md_iovector._stat64 = (_MD_Stat64)stat;
#else
_md_iovector._fstat64 = fstat64;
_md_iovector._stat64 = stat64;