Skip to content

Commit

Permalink
Ifdef unistd for msvc only
Browse files Browse the repository at this point in the history
  • Loading branch information
hallarempt committed Apr 19, 2016
1 parent 19e4bc2 commit 6c1a9d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions winquirks/unistd.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#ifndef QUIRK_UNISTD_H
#define QUIRK_UNISTD_H

#ifndef _MSC_VER
#include <unistd.h>
#else

#pragma message("winquirk: no unistd.h!")

#include <winsock2.h>
Expand Down Expand Up @@ -113,9 +118,11 @@ static int gethostname(char *__name, size_t __len) {
#define STDERR_FILENO 2
#endif

#if defined _MSC_VER
#if _MSC_VER < 1600
#define ENOTSUP ENOSYS
#endif
#endif
typedef unsigned int gid_t;
typedef unsigned int uid_t;

Expand Down Expand Up @@ -179,3 +186,4 @@ static int sleep(unsigned int sec) {
}

#endif
#endif

0 comments on commit 6c1a9d9

Please sign in to comment.