Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / base / checks.cc
1 /*
2  *  Copyright 2006 The WebRTC Project Authors. All rights reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <stdarg.h>
14
15 #include "webrtc/base/checks.h"
16 #include "webrtc/base/logging.h"
17
18 namespace rtc {
19
20 void Fatal(const char* file, int line, const char* format, ...) {
21   char msg[256];
22
23   va_list arguments;
24   va_start(arguments, format);
25   vsnprintf(msg, sizeof(msg), format, arguments);
26   va_end(arguments);
27
28   LOG(LS_ERROR) << "\n\n#\n# Fatal error in " << file
29                 << ", line " << line << "\n# " << msg
30                 << "\n#\n";
31   abort();
32 }
33
34 }  // namespace rtc