]>
Commit | Line | Data |
---|---|---|
285b36d6 BK |
1 | // Debugging support implementation -*- C++ -*- |
2 | ||
5624e564 | 3 | // Copyright (C) 2003-2015 Free Software Foundation, Inc. |
285b36d6 BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
748086b7 | 8 | // Free Software Foundation; either version 3, or (at your option) |
285b36d6 BK |
9 | // any later version. |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
748086b7 JJ |
16 | // Under Section 7 of GPL version 3, you are granted additional |
17 | // permissions described in the GCC Runtime Library Exception, version | |
18 | // 3.1, as published by the Free Software Foundation. | |
285b36d6 | 19 | |
748086b7 JJ |
20 | // You should have received a copy of the GNU General Public License and |
21 | // a copy of the GCC Runtime Library Exception along with this program; | |
22 | // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see | |
23 | // <http://www.gnu.org/licenses/>. | |
285b36d6 | 24 | |
78a53887 BK |
25 | /** @file debug/debug.h |
26 | * This file is a GNU debug extension to the Standard C++ Library. | |
27 | */ | |
28 | ||
45f388bb BK |
29 | #ifndef _GLIBCXX_DEBUG_MACRO_SWITCH_H |
30 | #define _GLIBCXX_DEBUG_MACRO_SWITCH_H 1 | |
31 | ||
32 | /** Macros and namespaces used by the implementation outside of debug | |
33 | * wrappers to verify certain properties. The __glibcxx_requires_xxx | |
34 | * macros are merely wrappers around the __glibcxx_check_xxx wrappers | |
35 | * when we are compiling with debug mode, but disappear when we are | |
36 | * in release mode so that there is no checking performed in, e.g., | |
37 | * the standard library algorithms. | |
285b36d6 | 38 | */ |
d2763ab5 | 39 | |
adad2a7d FD |
40 | #include <debug/assertions.h> |
41 | ||
45f388bb | 42 | // Debug mode namespaces. |
939759fc BK |
43 | |
44 | /** | |
45 | * @namespace std::__debug | |
46 | * @brief GNU debug code, replaces standard behavior with debug behavior. | |
47 | */ | |
12ffa228 | 48 | namespace std |
3cbc7af0 | 49 | { |
45f388bb | 50 | namespace __debug { } |
3cbc7af0 BK |
51 | } |
52 | ||
939759fc BK |
53 | /** @namespace __gnu_debug |
54 | * @brief GNU debug classes for public use. | |
55 | */ | |
7ec4a5ce BK |
56 | namespace __gnu_debug |
57 | { | |
45f388bb | 58 | using namespace std::__debug; |
7ec4a5ce | 59 | } |
3cbc7af0 | 60 | |
45f388bb BK |
61 | #ifndef _GLIBCXX_DEBUG |
62 | ||
45f388bb BK |
63 | # define __glibcxx_requires_cond(_Cond,_Msg) |
64 | # define __glibcxx_requires_valid_range(_First,_Last) | |
a8028a3e | 65 | # define __glibcxx_requires_non_empty_range(_First,_Last) |
45f388bb BK |
66 | # define __glibcxx_requires_sorted(_First,_Last) |
67 | # define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) | |
a4c07f2d PC |
68 | # define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) |
69 | # define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) | |
f5ad3163 PC |
70 | # define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) |
71 | # define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) | |
72 | # define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) | |
73 | # define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) | |
45f388bb BK |
74 | # define __glibcxx_requires_heap(_First,_Last) |
75 | # define __glibcxx_requires_heap_pred(_First,_Last,_Pred) | |
76 | # define __glibcxx_requires_nonempty() | |
77 | # define __glibcxx_requires_string(_String) | |
78 | # define __glibcxx_requires_string_len(_String,_Len) | |
79 | # define __glibcxx_requires_subscript(_N) | |
80 | ||
81 | #else | |
277d42e2 | 82 | |
3cbc7af0 | 83 | # include <debug/macros.h> |
277d42e2 | 84 | |
45f388bb BK |
85 | # define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg) |
86 | # define __glibcxx_requires_valid_range(_First,_Last) \ | |
285b36d6 | 87 | __glibcxx_check_valid_range(_First,_Last) |
a8028a3e JW |
88 | # define __glibcxx_requires_non_empty_range(_First,_Last) \ |
89 | __glibcxx_check_non_empty_range(_First,_Last) | |
45f388bb | 90 | # define __glibcxx_requires_sorted(_First,_Last) \ |
285b36d6 | 91 | __glibcxx_check_sorted(_First,_Last) |
45f388bb | 92 | # define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \ |
285b36d6 | 93 | __glibcxx_check_sorted_pred(_First,_Last,_Pred) |
a4c07f2d PC |
94 | # define __glibcxx_requires_sorted_set(_First1,_Last1,_First2) \ |
95 | __glibcxx_check_sorted_set(_First1,_Last1,_First2) | |
96 | # define __glibcxx_requires_sorted_set_pred(_First1,_Last1,_First2,_Pred) \ | |
97 | __glibcxx_check_sorted_set_pred(_First1,_Last1,_First2,_Pred) | |
f5ad3163 PC |
98 | # define __glibcxx_requires_partitioned_lower(_First,_Last,_Value) \ |
99 | __glibcxx_check_partitioned_lower(_First,_Last,_Value) | |
100 | # define __glibcxx_requires_partitioned_upper(_First,_Last,_Value) \ | |
101 | __glibcxx_check_partitioned_upper(_First,_Last,_Value) | |
102 | # define __glibcxx_requires_partitioned_lower_pred(_First,_Last,_Value,_Pred) \ | |
103 | __glibcxx_check_partitioned_lower_pred(_First,_Last,_Value,_Pred) | |
104 | # define __glibcxx_requires_partitioned_upper_pred(_First,_Last,_Value,_Pred) \ | |
105 | __glibcxx_check_partitioned_upper_pred(_First,_Last,_Value,_Pred) | |
45f388bb | 106 | # define __glibcxx_requires_heap(_First,_Last) \ |
285b36d6 | 107 | __glibcxx_check_heap(_First,_Last) |
45f388bb | 108 | # define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \ |
285b36d6 | 109 | __glibcxx_check_heap_pred(_First,_Last,_Pred) |
45f388bb BK |
110 | # define __glibcxx_requires_nonempty() __glibcxx_check_nonempty() |
111 | # define __glibcxx_requires_string(_String) __glibcxx_check_string(_String) | |
112 | # define __glibcxx_requires_string_len(_String,_Len) \ | |
285b36d6 | 113 | __glibcxx_check_string_len(_String,_Len) |
45f388bb | 114 | # define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N) |
d2763ab5 | 115 | |
45f388bb | 116 | # include <debug/functions.h> |
285b36d6 | 117 | |
526da49c | 118 | #endif |
45f388bb BK |
119 | |
120 | #endif // _GLIBCXX_DEBUG_MACRO_SWITCH_H |