Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

138 lines
5.7KB

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