mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
[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:
committed by
Konstantin Pastbin
parent
0ea0f2e49a
commit
7e5e6ec78e
@@ -8,18 +8,13 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#ifndef OMIM_OS_WINDOWS
|
#ifdef OMIM_OS_WINDOWS
|
||||||
#include <stdio.h>
|
#include "std/windows.hpp"
|
||||||
|
#else
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h> // _SC_PAGESIZE
|
#include <unistd.h> // _SC_PAGESIZE
|
||||||
#ifdef OMIM_OS_ANDROID
|
|
||||||
#include <fcntl.h>
|
|
||||||
#else
|
|
||||||
#include <sys/fcntl.h>
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -7,16 +7,12 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#ifdef OMIM_OS_WINDOWS
|
#ifdef OMIM_OS_WINDOWS
|
||||||
#include <windows.h>
|
#include "std/windows.hpp"
|
||||||
#else
|
#else
|
||||||
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef OMIM_OS_ANDROID
|
|
||||||
#include <fcntl.h>
|
|
||||||
#else
|
|
||||||
#include <sys/fcntl.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class MmapReader::MmapData
|
class MmapReader::MmapData
|
||||||
|
|||||||
Reference in New Issue
Block a user