[ofw] [PATCH] typeof() not supported in Windows WDK compiler

Sean Hefty sean.hefty at intel.com
Thu Oct 1 16:38:02 PDT 2009


>>> 	while (!cl_is_qlist_empty(&p_port->mcm_list)) {
>>> +#ifndef __WIN__
>>> 		mcm_port = cl_item_obj(cl_qlist_head(&p_port->mcm_list),
>>> 				       mcm_port, list_item);
>>> +#else
>>> +		mcm_port = cl_item_obj(cl_qlist_head(&p_port->mcm_list),
>>> +				       mcm_port, list_item, (osm_mcm_port_t*) );
>>> +#endif
>>
>> I'd find this more readable if it were #ifdef rather than #ifndef.
>
>So would I, although the convention is to only define something extra for
>Windows.
>Perhaps a gcc/cpp defined item could be recommended and agreed upon?
>
>>
>> That said, I've got to believe that there's a better way to handle
>> these changes.  I just don't know what it is.
>
>Agreed, I'm listening.

How about replacing cl_item_obj with something more common, like container_of()?




More information about the ofw mailing list