From 7e5e6ec78e88a1ff978151c5df1ff5633fcebb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20G=C3=A9czi?= Date: Tue, 29 Jul 2025 19:14:16 +0200 Subject: [PATCH] [libs][linux] Fix incorrect include of fcntl.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The POSIX standard says, that `fcntl.h` is to be included as `#include `. This change fixes the compiler warnings that happen with `musl` libc : ``` /usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include to [-Wcpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ In file included from /home/ferenc/github.com/organicmaps/organicmaps/libs/coding/mmap_reader.cpp:18, from /home/ferenc/github.com/organicmaps/organicmaps/build-alpine-3.21/build-alpine-3.21/libs/coding/CMakeFiles/coding.dir/Unity/unity_0_cxx.cxx:40: /usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include to [-Wcpp] 1 | #warning redirecting incorrect #include to | ^~~~~~~ ```` This happens because of the explicit [warning in the proxy header]( https://git.musl-libc.org/cgit/musl/tree/include/sys/fcntl.h) Signed-off-by: Ferenc Géczi --- libs/coding/files_container.cpp | 13 ++++--------- libs/coding/mmap_reader.cpp | 8 ++------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/libs/coding/files_container.cpp b/libs/coding/files_container.cpp index 267e45133..532c66366 100644 --- a/libs/coding/files_container.cpp +++ b/libs/coding/files_container.cpp @@ -8,18 +8,13 @@ #include #include -#ifndef OMIM_OS_WINDOWS -#include +#ifdef OMIM_OS_WINDOWS +#include "std/windows.hpp" +#else +#include #include #include #include // _SC_PAGESIZE -#ifdef OMIM_OS_ANDROID -#include -#else -#include -#endif -#else -#include #endif #include diff --git a/libs/coding/mmap_reader.cpp b/libs/coding/mmap_reader.cpp index 97ef3bb01..9043cbed1 100644 --- a/libs/coding/mmap_reader.cpp +++ b/libs/coding/mmap_reader.cpp @@ -7,16 +7,12 @@ #include #ifdef OMIM_OS_WINDOWS -#include +#include "std/windows.hpp" #else +#include #include #include #include -#ifdef OMIM_OS_ANDROID -#include -#else -#include -#endif #endif class MmapReader::MmapData