Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
View
@@ -6,7 +6,7 @@
COPTS=-g -Wall -Werror
# change this to select which poller is used.
-DEFS=-DUSE_EPOLL -DUSE_MOCK
+DEFS=-DUSE_SELECT -DUSE_MOCK
all: testclient testserver
2  README
View
@@ -72,7 +72,7 @@ To get events, use something like this for your main loop:
}
for(;;) {
- if(io_wait(&poller, MAXINT) < 0) {
+ if(io_wait(&poller, INT_MAX) < 0) {
perror("io_wait");
}
io_dispatch(&poller);
4 iotest.c
View
@@ -17,7 +17,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <values.h>
+#include <limits.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
@@ -173,7 +173,7 @@ void event_loop()
int cnt;
for(;;) {
- cnt = io_wait(&poller, MAXINT);
+ cnt = io_wait(&poller, INT_MAX);
if(cnt < 0) {
perror("io_wait");
}
3  pollers/kqueue.c
View
@@ -7,6 +7,7 @@
#ifdef USE_KQUEUE
#include <stdio.h>
+#include <limits.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/event.h>
@@ -117,7 +118,7 @@ int io_kqueue_wait(int timeout)
struct timeval *tvp = &tv;
int num;
- if(timeout == MAXINT) {
+ if(timeout == INT_MAX) {
tvp = NULL;
} else {
tv.tv_sec = timeout / 1000;
6 pollers/select.c
View
@@ -15,7 +15,7 @@
#include <stdlib.h>
#include <errno.h>
-#include <values.h>
+#include <limits.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
@@ -144,7 +144,7 @@ int io_select_remove(io_select_poller *poller, io_atom *atom)
/** Waits for events. See io_dispatch to dispatch the events.
*
* @param timeout The maximum amount of time we should wait in
- * milliseconds. MAXINT is special-cased to mean forever.
+ * milliseconds. INT_MAX is special-cased to mean forever.
*
* @returns the number of events to be dispatched or a negative
* 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)
struct timeval tv;
struct timeval *tvp = &tv;
- if(timeout == MAXINT) {
+ if(timeout == INT_MAX) {
tvp = NULL;
} else {
tv.tv_sec = timeout / 1000;
4 testclient.c
View
@@ -11,7 +11,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <values.h>
+#include <limits.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
}
for(;;) {
- if(io_wait(&poller, MAXINT) < 0) {
+ if(io_wait(&poller, INT_MAX) < 0) {
perror("io_wait");
}
io_dispatch(&poller);
4 testmock.c
View
@@ -18,7 +18,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <values.h>
+#include <limits.h>
#include <getopt.h>
#include "poller.h"
@@ -465,7 +465,7 @@ int main(int argc, char **argv)
// Run the main event loop.
for(;;) {
- if(io_wait(&poller, MAXINT) < 0) {
+ if(io_wait(&poller, INT_MAX) < 0) {
perror("io_wait");
}
io_dispatch(&poller);
4 testserver.c
View
@@ -12,7 +12,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-#include <values.h>
+#include <limits.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
@@ -203,7 +203,7 @@ int main(int argc, char **argv)
}
for(;;) {
- if(io_wait(&poller, MAXINT) < 0) {
+ if(io_wait(&poller, INT_MAX) < 0) {
perror("io_wait");
}
io_dispatch(&poller);
Please sign in to comment.
Something went wrong with that request. Please try again.