noduma.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * DUMA - Red-Zone memory allocator.
  3. * Copyright (C) 2002-2009 Hayati Ayguen <h_ayguen@web.de>, Procitec GmbH
  4. * Copyright (C) 1987-1999 Bruce Perens <bruce@perens.com>
  5. * License: GNU GPL (GNU General Public License, see COPYING-GPL)
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. *
  22. * FILE CONTENTS:
  23. * header file for inclusion from YOUR application code.
  24. * Include this header before including foreign includes
  25. * from inside your own headers files.
  26. */
  27. /* remove previous DUMA definitions */
  28. #ifdef DUMA_newFrame
  29. #undef DUMA_newFrame
  30. #endif
  31. #ifdef DUMA_delFrame
  32. #undef DUMA_delFrame
  33. #endif
  34. #ifdef DUMA_SET_ALIGNMENT
  35. #undef DUMA_SET_ALIGNMENT
  36. #endif
  37. #ifdef DUMA_SET_PROTECT_BELOW
  38. #undef DUMA_SET_PROTECT_BELOW
  39. #endif
  40. #ifdef DUMA_SET_FILL
  41. #undef DUMA_SET_FILL
  42. #endif
  43. /* remove previous wrappers to standard C functions */
  44. #ifdef malloc
  45. #undef malloc
  46. #endif
  47. #ifdef calloc
  48. #undef calloc
  49. #endif
  50. #ifdef free
  51. #undef free
  52. #endif
  53. #ifdef memalign
  54. #undef memalign
  55. #endif
  56. #ifdef posix_memalign
  57. #undef posix_memalign
  58. #endif
  59. #ifdef realloc
  60. #undef realloc
  61. #endif
  62. #ifdef valloc
  63. #undef valloc
  64. #endif
  65. #ifdef malloc_usable_size
  66. #undef malloc_usable_size
  67. #endif
  68. #ifdef strdup
  69. #undef strdup
  70. #endif
  71. #ifdef memcpy
  72. #undef memcpy
  73. #endif
  74. #ifdef memmove
  75. #undef memmove
  76. #endif
  77. #ifdef strcpy
  78. #undef strcpy
  79. #endif
  80. #ifdef strncpy
  81. #undef strncpy
  82. #endif
  83. #ifdef strcat
  84. #undef strcat
  85. #endif
  86. #ifdef strncat
  87. #undef strncat
  88. #endif
  89. #ifndef SKIP_DUMA_NO_CXX
  90. /* remove previous wrappers to standard C++ functions / operators */
  91. #ifdef new
  92. #undef new
  93. #endif
  94. #ifdef delete
  95. #undef delete
  96. #endif
  97. #ifdef new_NOTHROW
  98. #undef new_NOTHROW
  99. #endif
  100. /* remove previous DUMA C++ definitions */
  101. #ifdef NEW_ELEM
  102. #undef NEW_ELEM
  103. #endif
  104. #ifdef NEW_ARRAY
  105. #undef NEW_ARRAY
  106. #endif
  107. #ifdef NEW_ELEM_NOTHROW
  108. #undef NEW_ELEM_NOTHROW
  109. #endif
  110. #ifdef NEW_ARRAY_NOTHROW
  111. #undef NEW_ARRAY_NOTHROW
  112. #endif
  113. #ifdef DEL_ELEM
  114. #undef DEL_ELEM
  115. #endif
  116. #ifdef DEL_ARRAY
  117. #undef DEL_ARRAY
  118. #endif
  119. #ifdef DEL_ELEM_NOTHROW
  120. #undef DEL_ELEM_NOTHROW
  121. #endif
  122. #ifdef DEL_ARRAY_NOTHROW
  123. #undef DEL_ARRAY_NOTHROW
  124. #endif
  125. #endif /* SKIP_DUMA_NO_CXX */
  126. /* remove definitions for protection of functions return address */
  127. #ifdef DUMA_FN_PROT_START
  128. #undef DUMA_FN_PROT_START
  129. #endif
  130. #ifdef DUMA_FN_PROT_END
  131. #undef DUMA_FN_PROT_END
  132. #endif
  133. #ifdef DUMA_FN_PROT_RET
  134. #undef DUMA_FN_PROT_RET
  135. #endif
  136. #ifdef DUMA_FN_PROT_RET_VOID
  137. #undef DUMA_FN_PROT_RET_VOID
  138. #endif
  139. /* remove (C)hecked (A)rray definitions */
  140. #ifdef CA_DECLARE
  141. #undef CA_DECLARE
  142. #endif
  143. #ifdef CA_DEFINE
  144. #undef CA_DEFINE
  145. #endif
  146. #ifdef CA_REF
  147. #undef CA_REF
  148. #endif
  149. /* Following defines are kept:
  150. *
  151. * DUMA_ASSERT
  152. * DUMA_CHECK
  153. * DUMA_CHECKALL
  154. * DUMA_CDECL
  155. * DUMA_SIZE_T
  156. * DUMA_MAX_DEL_DEPTH
  157. *
  158. */