From: Fumitoshi Ukai Date: Thu, 17 Dec 2015 06:36:40 +0000 (+0900) Subject: win: FAILED macro can't be used with HANDLE. X-Git-Tag: submit/tizen/20180313.064233~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1256d28554ec32351ca8cceb1bfd7dbe9dfc055d;p=platform%2Fupstream%2Fglog.git win: FAILED macro can't be used with HANDLE. FAILED macro is for HRESULT, not for HANDLE. FindFirstFile returns INVALID_HANDLE_VALUE when error or not found. https://msdn.microsoft.com/library/windows/desktop/aa364418(v=vs.85).aspx fixes #79 --- diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc index e0e3676..b886222 100644 --- a/src/logging_unittest.cc +++ b/src/logging_unittest.cc @@ -628,7 +628,7 @@ static void GetFiles(const string& pattern, vector* files) { LOG(FATAL) << "No directory separator."; } const string dirname = pattern.substr(0, index + 1); - if (FAILED(handle)) { + if (handle == INVALID_HANDLE_VALUE) { // Finding no files is OK. return; }