Apache Mesos
unreachable.hpp
Go to the documentation of this file.
1 // Licensed under the Apache License, Version 2.0 (the "License");
2 // you may not use this file except in compliance with the License.
3 // You may obtain a copy of the License at
4 //
5 // http://www.apache.org/licenses/LICENSE-2.0
6 //
7 // Unless required by applicable law or agreed to in writing, software
8 // distributed under the License is distributed on an "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 // See the License for the specific language governing permissions and
11 // limitations under the License.
12 
13 #ifndef __STOUT_UNREACHABLE_HPP__
14 #define __STOUT_UNREACHABLE_HPP__
15 
16 #include <iostream>
17 
18 #include <stout/abort.hpp>
19 #include <stout/attributes.hpp>
20 
21 
22 #define UNREACHABLE() Unreachable(__FILE__, __LINE__)
23 
24 
25 inline NORETURN void Unreachable(const char* file, int line)
26 {
27  std::cerr << "Reached unreachable statement at " << file << ':'
28  << line << std::endl;
29  abort();
30 }
31 
32 
33 #endif // __STOUT_UNREACHABLE_HPP__
NORETURN void Unreachable(const char *file, int line)
Definition: unreachable.hpp:25
URI file(const std::string &path)
Creates a file URI with the given path on the local host.
Definition: file.hpp:33
#define NORETURN
Definition: attributes.hpp:20