Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cygwin isn't happy with values.h/MAXINT so convert to limits.h/INT_MAX

  • Loading branch information...
commit a0c3e4abd441ce71637e20eec81be2deb0ed9238 1 parent 358ff73
Scott Bronson authored
2  Makefile
@@ -6,7 +6,7 @@
6 6 COPTS=-g -Wall -Werror
7 7
8 8 # change this to select which poller is used.
9   -DEFS=-DUSE_EPOLL -DUSE_MOCK
  9 +DEFS=-DUSE_SELECT -DUSE_MOCK
10 10
11 11 all: testclient testserver
12 12
2  README
@@ -72,7 +72,7 @@ To get events, use something like this for your main loop:
72 72 }
73 73
74 74 for(;;) {
75   - if(io_wait(&poller, MAXINT) < 0) {
  75 + if(io_wait(&poller, INT_MAX) < 0) {
76 76 perror("io_wait");
77 77 }
78 78 io_dispatch(&poller);
4 iotest.c
@@ -17,7 +17,7 @@
17 17 #include <unistd.h>
18 18 #include <fcntl.h>
19 19 #include <errno.h>
20   -#include <values.h>
  20 +#include <limits.h>
21 21 #include <sys/socket.h>
22 22 #include <sys/ioctl.h>
23 23 #include <netinet/in.h>
@@ -173,7 +173,7 @@ void event_loop()
173 173 int cnt;
174 174
175 175 for(;;) {
176   - cnt = io_wait(&poller, MAXINT);
  176 + cnt = io_wait(&poller, INT_MAX);
177 177 if(cnt < 0) {
178 178 perror("io_wait");
179 179 }
3  pollers/kqueue.c
@@ -7,6 +7,7 @@
7 7 #ifdef USE_KQUEUE
8 8
9 9 #include <stdio.h>
  10 +#include <limits.h>
10 11 #include <sys/time.h>
11 12 #include <sys/types.h>
12 13 #include <sys/event.h>
@@ -117,7 +118,7 @@ int io_kqueue_wait(int timeout)
117 118 struct timeval *tvp = &tv;
118 119 int num;
119 120
120   - if(timeout == MAXINT) {
  121 + if(timeout == INT_MAX) {
121 122 tvp = NULL;
122 123 } else {
123 124 tv.tv_sec = timeout / 1000;
6 pollers/select.c
@@ -15,7 +15,7 @@
15 15
16 16 #include <stdlib.h>
17 17 #include <errno.h>
18   -#include <values.h>
  18 +#include <limits.h>
19 19 #include <sys/time.h>
20 20 #include <sys/types.h>
21 21 #include <unistd.h>
@@ -144,7 +144,7 @@ int io_select_remove(io_select_poller *poller, io_atom *atom)
144 144 /** Waits for events. See io_dispatch to dispatch the events.
145 145 *
146 146 * @param timeout The maximum amount of time we should wait in
147   - * milliseconds. MAXINT is special-cased to mean forever.
  147 + * milliseconds. INT_MAX is special-cased to mean forever.
148 148 *
149 149 * @returns the number of events to be dispatched or a negative
150 150 * number if there was an error. If a signal interrupted the
@@ -157,7 +157,7 @@ int io_select_wait(io_select_poller *poller, unsigned int timeout)
157 157 struct timeval tv;
158 158 struct timeval *tvp = &tv;
159 159
160   - if(timeout == MAXINT) {
  160 + if(timeout == INT_MAX) {
161 161 tvp = NULL;
162 162 } else {
163 163 tv.tv_sec = timeout / 1000;
4 testclient.c
@@ -11,7 +11,7 @@
11 11 #include <unistd.h>
12 12 #include <fcntl.h>
13 13 #include <errno.h>
14   -#include <values.h>
  14 +#include <limits.h>
15 15 #include <sys/socket.h>
16 16 #include <sys/ioctl.h>
17 17 #include <netinet/in.h>
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
120 120 }
121 121
122 122 for(;;) {
123   - if(io_wait(&poller, MAXINT) < 0) {
  123 + if(io_wait(&poller, INT_MAX) < 0) {
124 124 perror("io_wait");
125 125 }
126 126 io_dispatch(&poller);
4 testmock.c
@@ -18,7 +18,7 @@
18 18 #include <stdlib.h>
19 19 #include <string.h>
20 20 #include <errno.h>
21   -#include <values.h>
  21 +#include <limits.h>
22 22 #include <getopt.h>
23 23 #include "poller.h"
24 24
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
465 465
466 466 // Run the main event loop.
467 467 for(;;) {
468   - if(io_wait(&poller, MAXINT) < 0) {
  468 + if(io_wait(&poller, INT_MAX) < 0) {
469 469 perror("io_wait");
470 470 }
471 471 io_dispatch(&poller);
4 testserver.c
@@ -12,7 +12,7 @@
12 12 #include <unistd.h>
13 13 #include <fcntl.h>
14 14 #include <errno.h>
15   -#include <values.h>
  15 +#include <limits.h>
16 16 #include <sys/socket.h>
17 17 #include <sys/ioctl.h>
18 18 #include <netinet/in.h>
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
203 203 }
204 204
205 205 for(;;) {
206   - if(io_wait(&poller, MAXINT) < 0) {
  206 + if(io_wait(&poller, INT_MAX) < 0) {
207 207 perror("io_wait");
208 208 }
209 209 io_dispatch(&poller);

0 comments on commit a0c3e4a

Please sign in to comment.
Something went wrong with that request. Please try again.