Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
13d1baf7
Commit
13d1baf7
authored
Nov 23, 2014
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MinGW build.
parent
9662a6a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
miniposix.h
c++/src/kj/miniposix.h
+20
-8
No files found.
c++/src/kj/miniposix.h
View file @
13d1baf7
...
...
@@ -32,7 +32,9 @@
#if _WIN32
#include <io.h>
#include <direct.h>
#else
#endif
#if !_WIN32 || __MINGW32__
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
...
...
@@ -41,7 +43,7 @@
namespace
kj
{
namespace
miniposix
{
#if _WIN32 && !__
GNUC
__
#if _WIN32 && !__
MINGW32
__
// We're on Windows and not MinGW. So, we need to define wrappers for the POSIX API.
typedef
int
ssize_t
;
...
...
@@ -55,12 +57,6 @@ inline ssize_t write(int fd, const void* buffer, size_t size) {
inline
int
close
(
int
fd
)
{
return
::
_close
(
fd
);
}
inline
int
pipe
(
int
fds
[
2
])
{
return
::
_pipe
(
fds
,
4096
,
false
);
}
inline
int
mkdir
(
const
char
*
path
,
int
mode
)
{
return
::
_mkdir
(
path
);
}
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
...
...
@@ -79,6 +75,22 @@ using ::ssize_t;
using
::
read
;
using
::
write
;
using
::
close
;
#endif
#if _WIN32
// We're on Windows, including MinGW. pipe() and mkdir() are non-standard even on MinGW.
inline
int
pipe
(
int
fds
[
2
])
{
return
::
_pipe
(
fds
,
4096
,
false
);
}
inline
int
mkdir
(
const
char
*
path
,
int
mode
)
{
return
::
_mkdir
(
path
);
}
#else
// We're on real POSIX.
using
::
pipe
;
using
::
mkdir
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment