diff --git a/src/connection.h b/src/connection.h index 2e2da2d..6a548ce 100644 --- a/src/connection.h +++ b/src/connection.h @@ -5,6 +5,9 @@ #include #include +// not really connectiony, but need per-platform +int GetProcessId(); + struct BaseConnection { static BaseConnection* Create(); static void Destroy(BaseConnection*&); diff --git a/src/connection_unix.cpp b/src/connection_unix.cpp index fbf5a23..50e5199 100644 --- a/src/connection_unix.cpp +++ b/src/connection_unix.cpp @@ -1,5 +1,13 @@ #include "connection.h" +#include +#include + +int GetProcessId() +{ + return ::getpid(); +} + const int RpcVersion = 1; const int NumFrames = 4; diff --git a/src/connection_win.cpp b/src/connection_win.cpp index 1a5a445..9497170 100644 --- a/src/connection_win.cpp +++ b/src/connection_win.cpp @@ -6,6 +6,11 @@ #define NOIME #include +int GetProcessId() +{ + return ::GetCurrentProcessId(); +} + struct BaseConnectionWin : public BaseConnection { HANDLE pipe{INVALID_HANDLE_VALUE}; };