Why does the definiton of SWITCH_ADD_AP has a for(;;;) looping in it? #define SWITCH_ADD_API(api_int, int_name, descript, funcptr, syntax_string) \ for (;;) { \ api_int = (switch_api_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_API_INTERFACE); \ api_int->interface_name = int_name; \ api_int->desc = descript; \ api_int->function = funcptr; \ api_int->syntax = syntax_string; \ break; \ } Thanks, Valter
it allows you to make a block in the middle of code without causing warnings on some compilers. This keeps warnings due to trailing ; from happening on some compilers. On Sep 10, 2013, at 3:31 PM, Valter Nogueira <valter@fastway.com.br> wrote:
Why does the definiton of SWITCH_ADD_AP has a for(;;;) looping in it?
#define SWITCH_ADD_API(api_int, int_name, descript, funcptr, syntax_string) \ for (;;) { \ api_int = (switch_api_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_API_INTERFACE); \ api_int->interface_name = int_name; \ api_int->desc = descript; \ api_int->function = funcptr; \ api_int->syntax = syntax_string; \ break; \ }
participants (2)
-
Michael Jerris
-
Valter Nogueira