Skip to content

Commit b4aa769

Browse files
committed
Move S_I* constants and MSG_NOSIGNAL to compat.h
1 parent af8297c commit b4aa769

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/compat.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ typedef u_int SOCKET;
5959
#define SOCKET_ERROR -1
6060
#endif
6161

62+
#ifdef WIN32
63+
#ifndef S_IRUSR
64+
#define S_IRUSR 0400
65+
#define S_IWUSR 0200
66+
#endif
67+
#else
68+
#define MAX_PATH 1024
69+
#endif
70+
71+
// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0
72+
#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL)
73+
#define MSG_NOSIGNAL 0
74+
#endif
75+
6276
#ifndef WIN32
6377
// PRIO_MAX is not defined on Solaris
6478
#ifndef PRIO_MAX

src/util.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,6 @@ static const int64_t CENT = 1000000;
4646
// This is needed because the foreach macro can't get over the comma in pair<t1, t2>
4747
#define PAIRTYPE(t1, t2) std::pair<t1, t2>
4848

49-
#ifdef WIN32
50-
#define MSG_DONTWAIT 0
51-
52-
#ifndef S_IRUSR
53-
#define S_IRUSR 0400
54-
#define S_IWUSR 0200
55-
#endif
56-
#else
57-
#define MAX_PATH 1024
58-
#endif
59-
// As Solaris does not have the MSG_NOSIGNAL flag for send(2) syscall, it is defined as 0
60-
#if !defined(HAVE_MSG_NOSIGNAL) && !defined(MSG_NOSIGNAL)
61-
#define MSG_NOSIGNAL 0
62-
#endif
6349

6450
inline void MilliSleep(int64_t n)
6551
{

0 commit comments

Comments
 (0)