Debian Codegraph @

src/util.h

raw symbols SCIP
1 // Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4
5 #ifndef CEFCLIENT_UTIL_H_
6 #define CEFCLIENT_UTIL_H_
7 #pragma once
8
9 #ifdef QCS_HTML5
10 #include "include/cef_task.h"
11 #endif
12 #if defined(OS_WIN)
13
14 #include <windows.h> // NOLINT(build/include_order)
15
16 #ifndef NDEBUG
17 #define ASSERT(condition) if (!(condition)) { DebugBreak(); }
18 #else
19 #define ASSERT(condition) ((void)0)
20 #endif
21
22 #else // !OS_WIN
23
24 #include <assert.h> // NOLINT(build/include_order)
25
26 #ifndef NDEBUG
27 #define ASSERT(condition) if (!(condition)) { assert(false); }
28 #else
29 #define ASSERT(condition) ((void)0)
30 #endif
31
32 #endif // !OS_WIN
33
34 #define REQUIRE_UI_THREAD() ASSERT(CefCurrentlyOn(TID_UI));
35 #define REQUIRE_IO_THREAD() ASSERT(CefCurrentlyOn(TID_IO));
36 #define REQUIRE_FILE_THREAD() ASSERT(CefCurrentlyOn(TID_FILE));
37
38 #endif // CEFCLIENT_UTIL_H_