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

Smith, Stan stan.smith at intel.com
Mon Sep 28 16:12:15 PDT 2009


Hefty, Sean wrote:
>> +#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.



More information about the ewg mailing list