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

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


Hello,
  Adding Windows version of OSM_LOG macro to accommodate windows syntax for cpp varargs.

Signed-off-by: Stan Smith (stan.smith at intel.com)

diff --git a/opensm/include/opensm/osm_log.h b/opensm/include/opensm/osm_log.h
index 20999d9..54c8ea4 100644
--- a/opensm/include/opensm/osm_log.h
+++ b/opensm/include/opensm/osm_log.h
@@ -390,10 +390,18 @@ extern void osm_log_msg_box(osm_log_t *log, osm_log_level_t level,
 extern void osm_log_raw(IN osm_log_t * const p_log,
 	    IN const osm_log_level_t verbosity, IN const char *p_buf);
 
+#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__); \
+} 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
 
 #define OSM_LOG_MSG_BOX(log, level, msg) \
 




More information about the ewg mailing list