| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ | 5 #ifndef ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ |
| 6 #define ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ | 6 #define ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 // Checks for Win32 result and if it indicates failure, returns it. | 10 // Checks for Win32 result and if it indicates failure, returns it. |
| 11 #define RETURN_IF_ERROR(cmd) \ | 11 #define RETURN_IF_ERROR(cmd) \ |
| 12 do { \ | 12 do { \ |
| 13 DWORD result_ = (cmd); \ | 13 DWORD result_ = (cmd); \ |
| 14 if (0 != result_) \ | 14 if (0 != result_) \ |
| 15 return result_; \ | 15 return result_; \ |
| 16 } \ | 16 } \ |
| 17 while (0); | 17 while (0); |
| 18 | 18 |
| 19 #endif // ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ | 19 #endif // ENCODINGS_COMPACT_LANG_DET_WIN_CLD_MACROS_H_ |
| OLD | NEW |