From 9197489840a2cf34f279f9d157861aec70423c75 Mon Sep 17 00:00:00 2001 From: LRN Date: Sat, 10 Nov 2012 05:51:20 +0000 Subject: [PATCH] Update gauger C binding for W32 --- src/include/gauger.h | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/include/gauger.h b/src/include/gauger.h index 175837c3d..c8b4c0e2c 100644 --- a/src/include/gauger.h +++ b/src/include/gauger.h @@ -79,10 +79,31 @@ }\ } -#else +#else /* WINDOWS */ -#define GAUGER_ID(category, counter, value, unit, id) {} -#define GAUGER(category, counter, value, unit) {} +#include +#include +#include + +#define GAUGER(category, counter, value, unit)\ +{\ + char __gauger_commandline[MAX_PATH];\ + \ + snprintf (__gauger_commandline, MAX_PATH, "gauger.py -n %s -d %Lf -u %s -c %s",\ + counter, (long double) (value), unit, category);\ + __gauger_commandline[MAX_PATH - 1] = '\0';\ + system (__gauger_commandline);\ +} + +#define GAUGER_ID(category, counter, value, unit, id)\ +{\ + char __gauger_commandline[MAX_PATH];\ + \ + snprintf (__gauger_commandline, MAX_PATH, "gauger.py -n %s -d %Lf -u %s -i %s -c %s",\ + counter, (long double) (value), unit, id, category);\ + __gauger_commandline[MAX_PATH - 1] = '\0';\ + system (__gauger_commandline);\ +} #endif // WINDOWS -- 2.25.1