Browse code

-minor cosmetic change: if stun variables are used in the config, but stun support is not compiled => warning

Andrei Pelinescu-Onciul authored on 25/10/2006 16:54:32
Showing 1 changed files
... ...
@@ -140,6 +140,12 @@
140 140
 	#define IF_DST_BLACKLIST(x) warn("dst blacklist support not compiled in")
141 141
 #endif
142 142
 
143
+#ifdef USE_STUN
144
+	#define IF_STUN(x) x
145
+#else 
146
+	#define IF_STUN(x) warn("stun support not compiled in")
147
+#endif
148
+
143 149
 
144 150
 extern int yylex();
145 151
 static void yyerror(char* s);
... ...
@@ -872,23 +878,11 @@ assign_stm:
872 872
 	| TOS EQUAL error { yyerror("number expected"); }
873 873
 	| KILL_TIMEOUT EQUAL NUMBER { ser_kill_timeout=$3; }
874 874
 	| KILL_TIMEOUT EQUAL error { yyerror("number expected"); }
875
-	| STUN_REFRESH_INTERVAL EQUAL NUMBER { 
876
-		#ifdef USE_STUN
877
-			stun_refresh_interval=$3;
878
-		#endif
879
-		}
875
+	| STUN_REFRESH_INTERVAL EQUAL NUMBER { IF_STUN(stun_refresh_interval=$3); }
880 876
 	| STUN_REFRESH_INTERVAL EQUAL error{ yyerror("number expected"); }
881
-	| STUN_ALLOW_STUN EQUAL NUMBER { 
882
-		#ifdef USE_STUN
883
-			stun_allow_stun=$3;
884
-		#endif
885
-		}
877
+	| STUN_ALLOW_STUN EQUAL NUMBER { IF_STUN(stun_allow_stun=$3); }
886 878
 	| STUN_ALLOW_STUN EQUAL error{ yyerror("number expected"); }
887
-	| STUN_ALLOW_FP EQUAL NUMBER { 
888
-		#ifdef USE_STUN
889
-			stun_allow_fp=$3;
890
-		#endif
891
-		}
879
+	| STUN_ALLOW_FP EQUAL NUMBER { IF_STUN(stun_allow_fp=$3) ; }
892 880
 	| STUN_ALLOW_FP EQUAL error{ yyerror("number expected"); }
893 881
 	| error EQUAL { yyerror("unknown config variable"); }
894 882
 	;