[libs][linux] Fix incorrect include of fcntl.h

The POSIX standard says, that `fcntl.h` is to be included as `#include <fcntl.h>`.

This change fixes the compiler warnings that happen with `musl` libc :
```
/usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Wcpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
      |  ^~~~~~~
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 <sys/fcntl.h> to <fcntl.h> [-Wcpp]
    1 | #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h>
      |  ^~~~~~~
````

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 <ferenc.gm@gmail.com>
This commit is contained in:
Ferenc Géczi
2025-07-29 19:14:16 +02:00
committed by Konstantin Pastbin
parent 0ea0f2e49a
commit 7e5e6ec78e
2 changed files with 6 additions and 15 deletions

View File

@@ -8,18 +8,13 @@
#include <cstring>
#include <sstream>
#ifndef OMIM_OS_WINDOWS
#include <stdio.h>
#ifdef OMIM_OS_WINDOWS
#include "std/windows.hpp"
#else
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h> // _SC_PAGESIZE
#ifdef OMIM_OS_ANDROID
#include <fcntl.h>
#else
#include <sys/fcntl.h>
#endif
#else
#include <windows.h>
#endif
#include <errno.h>

View File

@@ -7,16 +7,12 @@
#include <cstring>
#ifdef OMIM_OS_WINDOWS
#include <windows.h>
#include "std/windows.hpp"
#else
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#ifdef OMIM_OS_ANDROID
#include <fcntl.h>
#else
#include <sys/fcntl.h>
#endif
#endif
class MmapReader::MmapData