From aaef083794f6e88034ae40549dcf595ac161bd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Tue, 20 Oct 2015 09:37:29 +0000 Subject: Facebook: Adapt to use std_string_utils git-svn-id: http://svn.miranda-ng.org/main/trunk@15576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/stdafx.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'protocols/FacebookRM/src/stdafx.h') diff --git a/protocols/FacebookRM/src/stdafx.h b/protocols/FacebookRM/src/stdafx.h index 2e16e05152..1e832cd94a 100644 --- a/protocols/FacebookRM/src/stdafx.h +++ b/protocols/FacebookRM/src/stdafx.h @@ -64,12 +64,13 @@ along with this program. If not, see . class FacebookProto; +#include "../../utils/std_string_utils.h" + #include "constants.h" #include "definitions.h" #include "entities.h" #include "http.h" #include "list.hpp" -#include "utils.h" #include "client.h" #include "proto.h" #include "json.h" @@ -81,4 +82,26 @@ class FacebookProto; extern HINSTANCE g_hInstance; extern std::string g_strUserAgent; -extern DWORD g_mirandaVersion; \ No newline at end of file +extern DWORD g_mirandaVersion; + +class ScopedLock +{ +public: + ScopedLock(HANDLE h, int t = INFINITE) : handle_(h), timeout_(t) + { + WaitForSingleObject(handle_,timeout_); + } + ~ScopedLock() + { + if(handle_) + ReleaseMutex(handle_); + } + void Unlock() + { + ReleaseMutex(handle_); + handle_ = 0; + } +private: + HANDLE handle_; + int timeout_; +}; -- cgit v1.2.3