diff --git a/src/p_ceilng.c b/src/p_ceilng.c
index f355ee0110b3d8c323f388f58dbe65b23903774c..0cea8c52f00c0aaa991f6cc1bdeebed85b2495a0 100644
--- a/src/p_ceilng.c
+++ b/src/p_ceilng.c
@@ -395,7 +395,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
 	sector_t *sec;
 	ceiling_t *ceiling;
 	mtag_t tag = Tag_FGet(&line->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, secnum)
 	{
@@ -617,7 +617,7 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
 	sector_t *sec;
 	ceiling_t *ceiling;
 	mtag_t tag = Tag_FGet(&line->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, secnum)
 	{
diff --git a/src/p_floor.c b/src/p_floor.c
index 198148549d15c820d6df5707a69b7b8ec44d9d2c..98a26039ada2c861ae8d038e54f605285491fb20 100644
--- a/src/p_floor.c
+++ b/src/p_floor.c
@@ -635,7 +635,7 @@ void T_BounceCheese(bouncecheese_t *bouncer)
 	boolean remove;
 	INT32 i;
 	mtag_t tag = Tag_FGet(&bouncer->sourceline->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	if (bouncer->sector->crumblestate == CRUMBLE_RESTORE || bouncer->sector->crumblestate == CRUMBLE_WAIT
 		|| bouncer->sector->crumblestate == CRUMBLE_ACTIVATED) // Oops! Crumbler says to remove yourself!
@@ -775,7 +775,7 @@ void T_StartCrumble(crumble_t *crumble)
 	sector_t *sector;
 	INT32 i;
 	mtag_t tag = Tag_FGet(&crumble->sourceline->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	// Once done, the no-return thinker just sits there,
 	// constantly 'returning'... kind of an oxymoron, isn't it?
@@ -948,7 +948,7 @@ void T_StartCrumble(crumble_t *crumble)
 void T_MarioBlock(mariothink_t *block)
 {
 	INT32 i;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	T_MovePlane
 	(
@@ -1295,7 +1295,7 @@ void T_NoEnemiesSector(noenemies_t *nobaddies)
 	INT32 secnum = -1;
 	boolean FOFsector = false;
 	mtag_t tag = Tag_FGet(&nobaddies->sourceline->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, secnum)
 	{
@@ -1308,7 +1308,7 @@ void T_NoEnemiesSector(noenemies_t *nobaddies)
 		{
 			INT32 targetsecnum = -1;
 			mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags);
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300)
 				continue;
@@ -1402,7 +1402,7 @@ void T_EachTimeThinker(eachtime_t *eachtime)
 	fixed_t bottomheight, topheight;
 	ffloor_t *rover;
 	mtag_t tag = Tag_FGet(&eachtime->sourceline->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	for (i = 0; i < MAXPLAYERS; i++)
 	{
@@ -1430,7 +1430,7 @@ void T_EachTimeThinker(eachtime_t *eachtime)
 		{
 			INT32 targetsecnum = -1;
 			mtag_t tag2 = Tag_FGet(&sec->lines[i]->tags);
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300)
 				continue;
@@ -1572,7 +1572,7 @@ void T_RaiseSector(raise_t *raise)
 	INT32 direction;
 	result_e res = 0;
 	mtag_t tag = raise->tag;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	if (raise->sector->crumblestate >= CRUMBLE_FALL || raise->sector->ceilingdata)
 		return;
@@ -1822,7 +1822,7 @@ void EV_DoFloor(line_t *line, floor_e floortype)
 	sector_t *sec;
 	floormove_t *dofloor;
 	mtag_t tag = Tag_FGet(&line->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, secnum)
 	{
@@ -2039,7 +2039,7 @@ void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed)
 	sector_t *sec;
 	elevator_t *elevator;
 	mtag_t tag = Tag_FGet(&line->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	// act on all sectors with the same tag as the triggering linedef
 	TAG_ITER_SECTORS(tag, secnum)
@@ -2339,7 +2339,7 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating,
 	sector_t *foundsec;
 	INT32 i;
 	mtag_t tag = Tag_FGet(&rover->master->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	// If floor is already activated, skip it
 	if (sec->floordata)
diff --git a/src/p_lights.c b/src/p_lights.c
index bb8ef69893173cfd4db2566f6f2aa64395a98ebd..326549477bf37110a58e8c2b9eeee099f5e74ec9 100644
--- a/src/p_lights.c
+++ b/src/p_lights.c
@@ -374,7 +374,7 @@ void P_FadeLightBySector(sector_t *sector, INT32 destvalue, INT32 speed, boolean
 void P_FadeLight(INT16 tag, INT32 destvalue, INT32 speed, boolean ticbased, boolean force)
 {
 	INT32 i;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	// search all sectors for ones with tag
 	TAG_ITER_SECTORS(tag, i)
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 61a376729077f7ee646d5a57563eec48beb4fc9c..2ae24b402b65b8b3a0f0b030fdfb0aab73d2c5ce 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -4631,7 +4631,7 @@ static boolean P_Boss4MoveCage(mobj_t *mobj, fixed_t delta)
 	INT32 snum;
 	sector_t *sector;
 	boolean gotcage = false;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, snum)
 	{
@@ -4717,7 +4717,7 @@ static void P_Boss4DestroyCage(mobj_t *mobj)
 	size_t a;
 	sector_t *sector, *rsec;
 	ffloor_t *rover;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(tag, snum)
 	{
diff --git a/src/p_setup.c b/src/p_setup.c
index 87fb2ac0d494f2bbd56268abe72b5b42e9255035..dd49ae0bec09853a3a0349f06b7392c04b5cfce6 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -2971,7 +2971,7 @@ static void P_ConvertBinaryMap(void)
 			INT32 check = -1;
 			INT32 paramline = -1;
 
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			TAG_ITER_LINES(tag, check)
 			{
@@ -3188,7 +3188,7 @@ static void P_ConvertBinaryMap(void)
 			INT32 firstline = -1;
 			mtag_t tag = mapthings[i].angle;
 
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			Tag_FSet(&mapthings[i].tags, tag);
 
diff --git a/src/p_slopes.c b/src/p_slopes.c
index 412d13dd2c84f5ce81059ce0f7da5c73157589ae..80278451a4d8a53e90bdc45d21fec932df0f66f9 100644
--- a/src/p_slopes.c
+++ b/src/p_slopes.c
@@ -546,7 +546,7 @@ static boolean P_SetSlopeFromTag(sector_t *sec, INT32 tag, boolean ceiling)
 {
 	INT32 i;
 	pslope_t **secslope = ceiling ? &sec->c_slope : &sec->f_slope;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	if (!tag || *secslope)
 		return false;
diff --git a/src/p_spec.c b/src/p_spec.c
index 39d7e9223738c3f00c8e4a13386b66ccf05d41e2..0746c65b05c81df538dbb985ab351ff8c1117655 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -2223,7 +2223,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
 	INT32 secnum = -1;
 	mobj_t *bot = NULL;
 	mtag_t tag = Tag_FGet(&line->tags);
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	I_Assert(!mo || !P_MobjWasRemoved(mo)); // If mo is there, mo must be valid!
 
@@ -3887,7 +3887,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
 		case 465: // Set linedef executor delay
 			{
 				INT32 linenum;
-				TAG_ITER_C
+				TAG_ITER_DECLARECOUNTER;
 
 				if (!udmf)
 					break;
@@ -5922,7 +5922,7 @@ void T_LaserFlash(laserthink_t *flash)
 	sector_t *sector;
 	sector_t *sourcesec = flash->sourceline->frontsector;
 	fixed_t top, bottom;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	TAG_ITER_SECTORS(flash->tag, s)
 	{
@@ -6204,7 +6204,7 @@ void P_SpawnSpecials(boolean fromnetsave)
 			INT32 s;
 			size_t sec;
 			ffloortype_e ffloorflags;
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			case 1: // Definable gravity per sector
 				sec = sides[*lines[i].sidenum].sector - sectors;
@@ -7098,7 +7098,7 @@ void P_SpawnSpecials(boolean fromnetsave)
   */
 static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers)
 {
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 	INT32 s;
 	mtag_t tag = Tag_FGet(&lines[line].tags);
 	size_t sec = sides[*lines[line].sidenum].sector-sectors;
@@ -7214,7 +7214,7 @@ void T_Scroll(scroll_t *s)
 		size_t i;
 		INT32 sect;
 		ffloor_t *rover;
-		TAG_ITER_C
+		TAG_ITER_DECLARECOUNTER;
 
 		case sc_side: // scroll wall texture
 			side = sides + s->affectee;
@@ -7466,7 +7466,7 @@ static void P_SpawnScrollers(void)
 		switch (special)
 		{
 			register INT32 s;
-			TAG_ITER_C
+			TAG_ITER_DECLARECOUNTER;
 
 			case 513: // scroll effect ceiling
 			case 533: // scroll and carry objects on ceiling
@@ -7604,7 +7604,7 @@ void T_Disappear(disappear_t *d)
 		ffloor_t *rover;
 		register INT32 s;
 		mtag_t afftag = Tag_FGet(&lines[d->affectee].tags);
-		TAG_ITER_C
+		TAG_ITER_DECLARECOUNTER;
 
 		TAG_ITER_SECTORS(afftag, s)
 		{
@@ -8337,7 +8337,7 @@ static void P_SpawnFriction(void)
 	fixed_t strength; // frontside texture offset controls magnitude
 	fixed_t friction; // friction value to be applied during movement
 	INT32 movefactor; // applied to each player move to simulate inertia
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	for (i = 0; i < numlines; i++, l++)
 		if (l->special == 540)
@@ -8882,7 +8882,7 @@ static void P_SpawnPushers(void)
 	mtag_t tag;
 	register INT32 s;
 	mobj_t *thing;
-	TAG_ITER_C
+	TAG_ITER_DECLARECOUNTER;
 
 	for (i = 0; i < numlines; i++, l++)
 	{
diff --git a/src/taglist.h b/src/taglist.h
index ab69787dd3f98140cf88ca5ac5fe2ef3d58f8f4b..caf99b807899dc0cd329c2aa8614c8fb81620154 100644
--- a/src/taglist.h
+++ b/src/taglist.h
@@ -61,7 +61,7 @@ INT32 Tag_FindLineSpecial(const INT16 special, const mtag_t tag);
 INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start);
 
 // Use this macro to declare the iterator position variable.
-#define TAG_ITER_C size_t tag_iterator_pos;
+#define TAG_ITER_DECLARECOUNTER size_t tag_iterator_pos
 
 #define TAG_ITER(fn, tag, id) for(tag_iterator_pos = 0; (id = fn(tag, tag_iterator_pos)) >= 0; tag_iterator_pos++)