From 0b172c65537fa3a8e1ef15b7be846bfd7f6ce7aa Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Tue, 8 Mar 2005 00:04:43 +0000 Subject: [PATCH] (NS_ALL) [_WIN32]: Change NS_EVERYTHING back to NS_ALL, #undef NS_ALL to prevent conflict with winsock2.h --- include/nsc.h | 2 +- src/lib/commands/tend.c | 4 ++-- src/lib/empthread/ntthread.c | 1 + src/lib/gen/io.c | 1 + src/lib/player/accept.c | 7 +++++-- src/lib/subs/nxtitem.c | 4 ++-- src/lib/subs/sarg.c | 4 ++-- src/lib/subs/snxtitem.c | 6 +++--- src/lib/subs/snxtsct.c | 4 ++-- src/lib/update/nxtitemp.c | 4 ++-- src/server/main.c | 1 + 11 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/nsc.h b/include/nsc.h index 801416be..e48c3323 100644 --- a/include/nsc.h +++ b/include/nsc.h @@ -129,7 +129,7 @@ typedef enum { NS_LIST, /* list of IDs */ NS_DIST, /* circular area */ NS_AREA, /* rectangular area */ - NS_EVERYTHING, /* everything */ + NS_ALL, /* everything */ NS_XY, /* one sector area */ NS_GROUP /* group, i.e. fleet, wing, army */ } ns_seltype; diff --git a/src/lib/commands/tend.c b/src/lib/commands/tend.c index 0d2c0b75..c26387e3 100644 --- a/src/lib/commands/tend.c +++ b/src/lib/commands/tend.c @@ -232,8 +232,8 @@ tend_nxtitem(struct nstr_item *np, void *ptr) case NS_LIST: /* The change is to take the player->owner check out here */ break; - case NS_EVERYTHING: - /* XXX maybe combine NS_LIST and NS_EVERYTHING later */ + case NS_ALL: + /* XXX maybe combine NS_LIST and NS_ALL later */ break; case NS_DIST: if (!xyinrange(gp->x, gp->y, &np->range)) { diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index f3c99762..18026a4e 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -56,6 +56,7 @@ #if defined(_WIN32) && defined(_EMPTH_WIN32) #include +#undef NS_ALL #include #include diff --git a/src/lib/gen/io.c b/src/lib/gen/io.c index fe97149e..271a2cd0 100644 --- a/src/lib/gen/io.c +++ b/src/lib/gen/io.c @@ -53,6 +53,7 @@ #if defined(_WIN32) #include +#undef NS_ALL #endif #include "misc.h" diff --git a/src/lib/player/accept.c b/src/lib/player/accept.c index 2581337a..eb160ff8 100644 --- a/src/lib/player/accept.c +++ b/src/lib/player/accept.c @@ -31,6 +31,11 @@ * Dave Pare, 1994 */ +#if defined(_WIN32) +#include +#undef NS_ALL +#endif + #include "prototypes.h" #include "misc.h" #include "proto.h" @@ -51,8 +56,6 @@ #include #include #include -#else -#include #endif #include #include diff --git a/src/lib/subs/nxtitem.c b/src/lib/subs/nxtitem.c index c702c38d..6a719812 100644 --- a/src/lib/subs/nxtitem.c +++ b/src/lib/subs/nxtitem.c @@ -72,8 +72,8 @@ nxtitem(struct nstr_item *np, void *ptr) if ((np->flags & EFF_OWNER) && !player->owner) selected = 0; break; - case NS_EVERYTHING: - /* XXX maybe combine NS_LIST and NS_EVERYTHING later */ + case NS_ALL: + /* XXX maybe combine NS_LIST and NS_ALL later */ break; case NS_DIST: if (!xyinrange(gp->x, gp->y, &np->range)) { diff --git a/src/lib/subs/sarg.c b/src/lib/subs/sarg.c index a0bf2b1e..6b87aa57 100644 --- a/src/lib/subs/sarg.c +++ b/src/lib/subs/sarg.c @@ -48,7 +48,7 @@ * #1, lx:ly,hx:hy --> NS_AREA * @x,y:dist --> NS_DIST * %d or %d/%d/%d --> NS_LIST - * * --> NS_EVERYTHING + * * --> NS_ALL * * or 0 for none of the above. */ @@ -61,7 +61,7 @@ sarg_type(char *str) if (c == '@') return NS_DIST; if (c == '*') - return NS_EVERYTHING; + return NS_ALL; if (c == '#' || strchr(str, ',') != 0) return NS_AREA; if (isdigit(c)) diff --git a/src/lib/subs/snxtitem.c b/src/lib/subs/snxtitem.c index e6b00cee..1f1896a2 100644 --- a/src/lib/subs/snxtitem.c +++ b/src/lib/subs/snxtitem.c @@ -40,7 +40,7 @@ /* * setup the nstr structure for sector selection. - * can select on NS_EVERYTHING, NS_AREA, NS_DIST, and NS_LIST. + * can select on NS_ALL, NS_AREA, NS_DIST, and NS_LIST. * iterate thru the "condarg" string looking * for arguments to compile into the nstr. */ @@ -89,7 +89,7 @@ snxtitem(struct nstr_item *np, int type, s_char *str) return 0; snxtitem_dist(np, type, cx, cy, dist); break; - case NS_EVERYTHING: + case NS_ALL: snxtitem_all(np, type); break; case NS_LIST: @@ -184,7 +184,7 @@ snxtitem_all(struct nstr_item *np, int type) { memset(np, 0, sizeof(*np)); np->cur = -1; - np->sel = NS_EVERYTHING; + np->sel = NS_ALL; np->type = type; np->index = -1; np->read = ef_read; diff --git a/src/lib/subs/snxtsct.c b/src/lib/subs/snxtsct.c index a737d848..5a03e9c6 100644 --- a/src/lib/subs/snxtsct.c +++ b/src/lib/subs/snxtsct.c @@ -41,7 +41,7 @@ /* * setup the nstr_sect structure for sector selection. - * can select on either NS_EVERYTHING, NS_AREA, or NS_RANGE + * can select on either NS_ALL, NS_AREA, or NS_RANGE * iterate thru the "condarg" string looking * for arguments to compile into the nstr. */ @@ -74,7 +74,7 @@ snxtsct(struct nstr_sect *np, s_char *str) return 0; snxtsct_dist(np, cx, cy, dist); break; - case NS_EVERYTHING: + case NS_ALL: /* fake "all" by doing a world-sized area query */ snxtsct_area(np, &wr); break; diff --git a/src/lib/update/nxtitemp.c b/src/lib/update/nxtitemp.c index 0b7015a9..b5ccbedd 100644 --- a/src/lib/update/nxtitemp.c +++ b/src/lib/update/nxtitemp.c @@ -74,8 +74,8 @@ nxtitemp(struct nstr_item *np, int owner) if ((np->flags & EFF_OWNER) && !owner) selected = 0; break; - case NS_EVERYTHING: - /* XXX maybe combine NS_LIST and NS_EVERYTHING later */ + case NS_ALL: + /* XXX maybe combine NS_LIST and NS_ALL later */ break; case NS_DIST: if (!xyinrange(gp->x, gp->y, &np->range)) { diff --git a/src/server/main.c b/src/server/main.c index 305fd507..1dc962f9 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -47,6 +47,7 @@ #if defined(_WIN32) #include +#undef NS_ALL #include #include "../lib/gen/getopt.h" #include "service.h"