Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base.cpp « base - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dc93a19ea29bf37b455a4a86f43c27c402a0d65b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "base/base.hpp"
#include "base/assert.hpp"
#include "base/exception.hpp"

#include "std/target_os.hpp"
#include "std/iostream.hpp"

#include <cassert>
#include <cstdlib>


namespace my
{
  void OnAssertFailedDefault(SrcPoint const & srcPoint, string const & msg)
  {
    std::cerr << "ASSERT FAILED" << endl
              << srcPoint.FileName() << ":" << srcPoint.Line() << endl
              << msg << endl;

#ifdef DEBUG
    assert(false);
#else
    std::abort();
#endif
  }

  AssertFailedFn OnAssertFailed = &OnAssertFailedDefault;

  AssertFailedFn SetAssertFunction(AssertFailedFn fn)
  {
    std::swap(OnAssertFailed, fn);
    return fn;
  }
}