[ofw] [OPENSM] add Windows syntax for varags in a macro

Sean Hefty sean.hefty at intel.com
Mon Sep 28 16:14:01 PDT 2009


>>> +#ifdef __WIN__
>>> +#define OSM_LOG(log, level, fmt, ...) \
>>> +do { \
>>> +	if (osm_log_is_active(log, (level))) \
>>> +		osm_log(log, level, "%s: " fmt, __func__, ## __VA_ARGS__); \
>>
>> __VA_ARGS__ should work on any platform.  libibmad : mad.h uses this
>> for windows and linux.
>>
>>> +} while (0)
>>> +#else
>>> #define OSM_LOG(log, level, fmt, arg...) do { \
>>> 		if (osm_log_is_active(log, (level))) \
>>> 			osm_log(log, level, "%s: " fmt, __func__, ##arg); \
} while
>(0)
>>> +#endif
>
>As coded it would not compile.

I'm suggesting to remove the #ifdef __WIN__ and remove the #else code.




More information about the ofw mailing list