Skip to content

Commit

Permalink
Fix #include for Windows in fd_handle.h: _S_IREAD and `_S_IWRIT…
Browse files Browse the repository at this point in the history
…E` are in

`<sys/stat.h>`.

And in `fd_handle.cc`: `_SH_DENYNO` is in `<share.h>`.

Remove unused `#inculde <sys/types.h>` from `fd_writer.h`. It uses
`OwnedFd::Permissions` instead of `mode_t`.

Remove unused `#include <share.h>` where `OwnedFd::Open()` is used.

PiperOrigin-RevId: 631698415
  • Loading branch information
QrczakMK committed May 8, 2024
1 parent 7ab6106 commit b756fe2
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion riegeli/bytes/fd_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include "riegeli/bytes/fd_handle.h"

#include <fcntl.h>

#ifdef _WIN32
#include <io.h>
#include <share.h>
#else
#include <unistd.h>
#endif
Expand Down
4 changes: 3 additions & 1 deletion riegeli/bytes/fd_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#ifndef RIEGELI_BYTES_FD_HANDLE_H_
#define RIEGELI_BYTES_FD_HANDLE_H_

#ifndef _WIN32
#ifdef _WIN32
#include <sys/stat.h>
#else
#include <sys/types.h>
#endif

Expand Down
1 change: 0 additions & 1 deletion riegeli/bytes/fd_mmap_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
#include <share.h>
#endif
#include <stddef.h>
#ifdef _WIN32
Expand Down
1 change: 0 additions & 1 deletion riegeli/bytes/fd_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
#include <share.h>
#endif
#include <stddef.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion riegeli/bytes/fd_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <fcntl.h>
#ifdef _WIN32
#include <io.h>
#include <share.h>
#endif
#include <stddef.h>
#include <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion riegeli/bytes/fd_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#ifdef _WIN32
#include <sys/stat.h>
#endif
#include <sys/types.h>

#include <string>
#include <type_traits>
Expand Down

0 comments on commit b756fe2

Please sign in to comment.