mirror of
https://github.com/preble/libpinproc
synced 2026-02-22 18:15:25 +01:00
More small tweaks for MSVC.
This commit is contained in:
@@ -115,7 +115,7 @@ void RunLoop(PRHandle proc)
|
||||
case kPREventTypeSwitchOpenNondebounced: stateText = "open(ndb)"; break;
|
||||
case kPREventTypeSwitchClosedNondebounced: stateText = "closed(ndb)"; break;
|
||||
}
|
||||
#ifdef _VC_
|
||||
#ifdef _MSC_VER
|
||||
struct _timeb tv;
|
||||
_ftime(&tv);
|
||||
#else
|
||||
@@ -130,7 +130,7 @@ void RunLoop(PRHandle proc)
|
||||
case kPREventTypeSwitchOpenNondebounced:
|
||||
case kPREventTypeSwitchClosedNondebounced:
|
||||
{
|
||||
#ifdef _VC_
|
||||
#ifdef _MSC_VER
|
||||
printf("%d.%03d switch % 3d: %s\n", tv.time-startTime, tv.millitm, event->value, stateText);
|
||||
#else
|
||||
printf("%d.%03d switch % 3d: %s\n", (int)(tv.tv_sec-startTime), (int)tv.tv_usec/1000, event->value, stateText);
|
||||
@@ -152,7 +152,7 @@ void RunLoop(PRHandle proc)
|
||||
}
|
||||
}
|
||||
PRFlushWriteData(proc);
|
||||
#ifdef _VC_
|
||||
#ifdef _MSC_VER
|
||||
Sleep(10);
|
||||
#else
|
||||
usleep(10*1000); // Sleep for 10ms so we aren't pegging the CPU.
|
||||
|
||||
@@ -31,16 +31,16 @@
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifndef _VC_
|
||||
#include <unistd.h>
|
||||
#ifndef _MSC_VER
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <cmath>
|
||||
#include "../../include/pinproc.h" // Include libpinproc's header.
|
||||
#include "pinproc.h" // Include libpinproc's header.
|
||||
#include <fstream>
|
||||
#include <yaml-cpp/yaml.h>
|
||||
|
||||
#ifdef _VC_
|
||||
#ifdef _MSC_VER
|
||||
#include <time.h>
|
||||
#include <sys/timeb.h>
|
||||
#include <windows.h>
|
||||
|
||||
Reference in New Issue
Block a user