1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef TRACELINE_LOGGING_H_ 6 #define TRACELINE_LOGGING_H_ 7 8 #include <windows.h> 9 #include <stdio.h> 10 11 #define CHECK(exp, ...) \ 12 if (!(exp)) { \ 13 printf("FAILED CHECK: %s\n %s:%d\n", #exp, __FILE__, __LINE__); \ 14 printf("\naborted.\n"); \ 15 if (::IsDebuggerPresent()) __debugbreak(); \ 16 exit(1); \ 17 } 18 19 #define NOTREACHED(...) \ 20 if (1) { \ 21 printf("NOTREACHED:\n %s:%d\n", __FILE__, __LINE__); \ 22 printf(__VA_ARGS__); \ 23 printf("\naborted.\n"); \ 24 if (::IsDebuggerPresent()) __debugbreak(); \ 25 exit(1); \ 26 } 27 28 #endif // TRACELINE_LOGGING_H_ 29