diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-01-24 22:04:08 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-01-24 22:04:08 +0300 |
commit | 606a4502e046ec9909e4aed276539ce8aebc375b (patch) | |
tree | 56308573d0f8d61015790073a40c0cc84fd7c2a1 /capture | |
parent | 901d690d551a0f2b12ebe1919678cdad9ca88779 (diff) |
Fix MSVC build.
"SIGINT is not supported for any Win32 application."
Diffstat (limited to 'capture')
-rw-r--r-- | capture/src/capture.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/capture/src/capture.cpp b/capture/src/capture.cpp index 18e9a0e1..69fd99ef 100644 --- a/capture/src/capture.cpp +++ b/capture/src/capture.cpp @@ -16,6 +16,7 @@ #include "../../server/TracyWorker.hpp" #include "getopt.h" +#ifndef _MSC_VER struct sigaction oldsigint; bool disconnect = false; @@ -23,6 +24,7 @@ void SigInt( int ) { disconnect = true; } +#endif static const char* TimeToString( int64_t ns ) { @@ -165,20 +167,24 @@ int main( int argc, char** argv ) while( !worker.HasData() ) std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ); printf( "\nQueue delay: %s\nTimer resolution: %s\n", TimeToString( worker.GetDelay() ), TimeToString( worker.GetResolution() ) ); +#ifndef _MSC_VER struct sigaction sigint; memset( &sigint, 0, sizeof( sigint ) ); sigint.sa_handler = SigInt; sigaction( SIGINT, &sigint, &oldsigint ); +#endif auto& lock = worker.GetMbpsDataLock(); while( worker.IsConnected() ) { +#ifndef _MSC_VER if( disconnect ) { worker.Disconnect(); disconnect = false; } +#endif lock.lock(); const auto mbps = worker.GetMbpsData().back(); |