@@ -262,8 +262,6 @@ lws_system_do_attach(struct lws_context_per_thread *pt)
262262 return 0 ;
263263}
264264
265- #endif
266-
267265void
268266lws_extip_report (struct lws_context * cx , lws_extip_src_t src ,
269267 const lws_sockaddr46 * sa46 , int af , int status ,
@@ -287,7 +285,9 @@ lws_extip_report(struct lws_context *cx, lws_extip_src_t src,
287285 }
288286
289287 if (memcmp (& old , target , sizeof (* target ))) {
288+ #if defined(LWS_WITH_IPV6 )
290289 int c = 0 ;
290+ #endif
291291 char payload [128 ], buf4 [64 ];
292292 char * p = payload , * end = payload + sizeof (payload );
293293
@@ -296,7 +296,9 @@ lws_extip_report(struct lws_context *cx, lws_extip_src_t src,
296296 if (cx -> ext_ipv4 .sa4 .sin_family == AF_INET ) {
297297 lws_sa46_write_numeric_address (& cx -> ext_ipv4 , buf4 , sizeof (buf4 ));
298298 p += lws_snprintf (p , lws_ptr_diff_size_t (end , p ), "\"%s\"" , buf4 );
299+ #if defined(LWS_WITH_IPV6 )
299300 c ++ ;
301+ #endif
300302 }
301303
302304#if defined(LWS_WITH_IPV6 )
@@ -340,3 +342,5 @@ lws_extip_get_best(struct lws_context *cx, int af, lws_sockaddr46 *sa46)
340342 memset (sa46 , 0 , sizeof (* sa46 ));
341343 return 1 ;
342344}
345+
346+ #endif
0 commit comments