error_macros.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. /*************************************************************************/
  2. /* error_macros.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef ERROR_MACROS_H
  31. #define ERROR_MACROS_H
  32. #include "core/typedefs.h"
  33. /**
  34. * Error macros. Unlike exceptions and asserts, these macros try to maintain consistency and stability
  35. * inside the code. It is recommended to always return processable data, so in case of an error,
  36. * the engine can keep working well.
  37. * In most cases, bugs and/or invalid data are not fatal and should never allow a perfectly running application
  38. * to fail or crash.
  39. */
  40. /**
  41. * Pointer to the error macro printing function. Reassign to any function to have errors printed
  42. */
  43. /** Function used by the error macros */
  44. // function, file, line, error, explanation
  45. enum ErrorHandlerType {
  46. ERR_HANDLER_ERROR,
  47. ERR_HANDLER_WARNING,
  48. ERR_HANDLER_SCRIPT,
  49. ERR_HANDLER_SHADER,
  50. };
  51. class String;
  52. typedef void (*ErrorHandlerFunc)(void *, const char *, const char *, int p_line, const char *, const char *, ErrorHandlerType p_type);
  53. struct ErrorHandlerList {
  54. ErrorHandlerFunc errfunc;
  55. void *userdata;
  56. ErrorHandlerList *next;
  57. ErrorHandlerList() {
  58. errfunc = 0;
  59. next = 0;
  60. userdata = 0;
  61. }
  62. };
  63. void add_error_handler(ErrorHandlerList *p_handler);
  64. void remove_error_handler(ErrorHandlerList *p_handler);
  65. void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  66. void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  67. void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const char *p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  68. void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const char *p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  69. void _err_print_error(const char *p_function, const char *p_file, int p_line, const char *p_error, const String &p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  70. void _err_print_error(const char *p_function, const char *p_file, int p_line, const String &p_error, const String &p_message, ErrorHandlerType p_type = ERR_HANDLER_ERROR);
  71. void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const char *p_message = "", bool fatal = false);
  72. void _err_print_index_error(const char *p_function, const char *p_file, int p_line, int64_t p_index, int64_t p_size, const char *p_index_str, const char *p_size_str, const String &p_message, bool fatal = false);
  73. #ifndef _STR
  74. #define _STR(m_x) #m_x
  75. #define _MKSTR(m_x) _STR(m_x)
  76. #endif
  77. #define _FNL __FILE__ ":"
  78. /** An index has failed if m_index<0 or m_index >=m_size, the function exits */
  79. #ifdef __GNUC__
  80. //#define FUNCTION_STR __PRETTY_FUNCTION__ - too annoying
  81. #define FUNCTION_STR __FUNCTION__
  82. #else
  83. #define FUNCTION_STR __FUNCTION__
  84. #endif
  85. // Don't use this directly; instead, use any of the CRASH_* macros
  86. #ifdef _MSC_VER
  87. #define GENERATE_TRAP \
  88. __debugbreak(); \
  89. /* Avoid warning about control paths */ \
  90. for (;;) { \
  91. }
  92. #else
  93. #define GENERATE_TRAP __builtin_trap();
  94. #endif
  95. // Used to strip debug messages in release mode
  96. #ifdef DEBUG_ENABLED
  97. #define DEBUG_STR(m_msg) m_msg
  98. #else
  99. #define DEBUG_STR(m_msg) ""
  100. #endif
  101. // (*): See https://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for
  102. /**
  103. * If `m_index` is less than 0 or greater than or equal to `m_size`, prints a generic
  104. * error message and returns from the function. This macro should be preferred to
  105. * `ERR_FAIL_COND` for bounds checking.
  106. */
  107. #define ERR_FAIL_INDEX(m_index, m_size) \
  108. do { \
  109. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  110. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
  111. return; \
  112. } \
  113. } while (0); // (*)
  114. /**
  115. * If `m_index` is less than 0 or greater than or equal to `m_size`, prints a custom
  116. * error message and returns from the function. This macro should be preferred to
  117. * `ERR_FAIL_COND_MSG` for bounds checking.
  118. */
  119. #define ERR_FAIL_INDEX_MSG(m_index, m_size, m_msg) \
  120. do { \
  121. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  122. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), DEBUG_STR(m_msg)); \
  123. return; \
  124. } \
  125. } while (0); // (*)
  126. /**
  127. * If `m_index` is less than 0 or greater than or equal to `m_size`,
  128. * prints a generic error message and returns the value specified in `m_retval`.
  129. * This macro should be preferred to `ERR_FAIL_COND_V` for bounds checking.
  130. */
  131. #define ERR_FAIL_INDEX_V(m_index, m_size, m_retval) \
  132. do { \
  133. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  134. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
  135. return m_retval; \
  136. } \
  137. } while (0); // (*)
  138. /**
  139. * If `m_index` is less than 0 or greater than or equal to `m_size`,
  140. * prints a custom error message and returns the value specified in `m_retval`.
  141. * This macro should be preferred to `ERR_FAIL_COND_V_MSG` for bounds checking.
  142. */
  143. #define ERR_FAIL_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \
  144. do { \
  145. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  146. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), DEBUG_STR(m_msg)); \
  147. return m_retval; \
  148. } \
  149. } while (0); // (*)
  150. /**
  151. * If `m_index` is greater than or equal to `m_size`,
  152. * prints a generic error message and returns the value specified in `m_retval`.
  153. * This macro should be preferred to `ERR_FAIL_COND_V` for unsigned bounds checking.
  154. */
  155. #define ERR_FAIL_UNSIGNED_INDEX_V(m_index, m_size, m_retval) \
  156. do { \
  157. if (unlikely((m_index) >= (m_size))) { \
  158. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size)); \
  159. return m_retval; \
  160. } \
  161. } while (0); // (*)
  162. /**
  163. * If `m_index` is greater than or equal to `m_size`,
  164. * prints a custom error message and returns the value specified in `m_retval`.
  165. * This macro should be preferred to `ERR_FAIL_COND_V_MSG` for unsigned bounds checking.
  166. */
  167. #define ERR_FAIL_UNSIGNED_INDEX_V_MSG(m_index, m_size, m_retval, m_msg) \
  168. do { \
  169. if (unlikely((m_index) >= (m_size))) { \
  170. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), DEBUG_STR(m_msg)); \
  171. return m_retval; \
  172. } \
  173. } while (0); // (*)
  174. /**
  175. * If `m_index` is less than 0 or greater than or equal to `m_size`,
  176. * crashes the engine immediately with a generic error message.
  177. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  178. * This macro should be preferred to `CRASH_COND` for bounds checking.
  179. */
  180. #define CRASH_BAD_INDEX(m_index, m_size) \
  181. do { \
  182. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  183. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), "", true); \
  184. GENERATE_TRAP \
  185. } \
  186. } while (0); // (*)
  187. /**
  188. * If `m_index` is less than 0 or greater than or equal to `m_size`,
  189. * crashes the engine immediately with a custom error message.
  190. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  191. * This macro should be preferred to `CRASH_COND` for bounds checking.
  192. */
  193. #define CRASH_BAD_INDEX_MSG(m_index, m_size, m_msg) \
  194. do { \
  195. if (unlikely((m_index) < 0 || (m_index) >= (m_size))) { \
  196. _err_print_index_error(FUNCTION_STR, __FILE__, __LINE__, m_index, m_size, _STR(m_index), _STR(m_size), m_msg, true); \
  197. GENERATE_TRAP \
  198. } \
  199. } while (0); // (*)
  200. /**
  201. * If `m_param` is `null`, prints a generic error message and returns from the function.
  202. */
  203. #define ERR_FAIL_NULL(m_param) \
  204. { \
  205. if (unlikely(!m_param)) { \
  206. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null."); \
  207. return; \
  208. } \
  209. }
  210. /**
  211. * If `m_param` is `null`, prints a custom error message and returns from the function.
  212. */
  213. #define ERR_FAIL_NULL_MSG(m_param, m_msg) \
  214. { \
  215. if (unlikely(!m_param)) { \
  216. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null.", DEBUG_STR(m_msg)); \
  217. return; \
  218. } \
  219. }
  220. /**
  221. * If `m_param` is `null`, prints a generic error message and returns the value specified in `m_retval`.
  222. */
  223. #define ERR_FAIL_NULL_V(m_param, m_retval) \
  224. { \
  225. if (unlikely(!m_param)) { \
  226. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null."); \
  227. return m_retval; \
  228. } \
  229. }
  230. /**
  231. * If `m_param` is `null`, prints a custom error message and returns the value specified in `m_retval`.
  232. */
  233. #define ERR_FAIL_NULL_V_MSG(m_param, m_retval, m_msg) \
  234. { \
  235. if (unlikely(!m_param)) { \
  236. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Parameter \"" _STR(m_param) "\" is null.", DEBUG_STR(m_msg)); \
  237. return m_retval; \
  238. } \
  239. }
  240. /**
  241. * If `m_cond` evaluates to `true`, prints a generic error message and returns from the function.
  242. */
  243. #define ERR_FAIL_COND(m_cond) \
  244. { \
  245. if (unlikely(m_cond)) { \
  246. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true."); \
  247. return; \
  248. } \
  249. }
  250. /**
  251. * If `m_cond` evaluates to `true`, prints a custom error message and returns from the function.
  252. */
  253. #define ERR_FAIL_COND_MSG(m_cond, m_msg) \
  254. { \
  255. if (unlikely(m_cond)) { \
  256. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true.", DEBUG_STR(m_msg)); \
  257. return; \
  258. } \
  259. }
  260. /**
  261. * If `m_cond` evaluates to `true`, crashes the engine immediately with a generic error message.
  262. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  263. */
  264. #define CRASH_COND(m_cond) \
  265. { \
  266. if (unlikely(m_cond)) { \
  267. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Condition \"" _STR(m_cond) "\" is true."); \
  268. GENERATE_TRAP \
  269. } \
  270. }
  271. /**
  272. * If `m_cond` evaluates to `true`, crashes the engine immediately with a custom error message.
  273. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  274. */
  275. #define CRASH_COND_MSG(m_cond, m_msg) \
  276. { \
  277. if (unlikely(m_cond)) { \
  278. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Condition \"" _STR(m_cond) "\" is true.", DEBUG_STR(m_msg)); \
  279. GENERATE_TRAP \
  280. } \
  281. }
  282. /**
  283. * If `m_cond` evaluates to `true`, prints a generic error message and returns the value specified in `m_retval`.
  284. */
  285. #define ERR_FAIL_COND_V(m_cond, m_retval) \
  286. { \
  287. if (unlikely(m_cond)) { \
  288. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Returned: " _STR(m_retval)); \
  289. return m_retval; \
  290. } \
  291. }
  292. /**
  293. * If `m_cond` evaluates to `true`, prints a custom error message and returns the value specified in `m_retval`.
  294. */
  295. #define ERR_FAIL_COND_V_MSG(m_cond, m_retval, m_msg) \
  296. { \
  297. if (unlikely(m_cond)) { \
  298. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Returned: " _STR(m_retval), DEBUG_STR(m_msg)); \
  299. return m_retval; \
  300. } \
  301. }
  302. /**
  303. * If `m_cond` evaluates to `true`, prints a custom error message and continues the loop the macro is located in.
  304. */
  305. #define ERR_CONTINUE(m_cond) \
  306. { \
  307. if (unlikely(m_cond)) { \
  308. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Continuing."); \
  309. continue; \
  310. } \
  311. }
  312. /**
  313. * If `m_cond` evaluates to `true`, prints a custom error message and continues the loop the macro is located in.
  314. */
  315. #define ERR_CONTINUE_MSG(m_cond, m_msg) \
  316. { \
  317. if (unlikely(m_cond)) { \
  318. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Continuing.", DEBUG_STR(m_msg)); \
  319. continue; \
  320. } \
  321. }
  322. /**
  323. * If `m_cond` evaluates to `true`, prints a generic error message and breaks from the loop the macro is located in.
  324. */
  325. #define ERR_BREAK(m_cond) \
  326. { \
  327. if (unlikely(m_cond)) { \
  328. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Breaking."); \
  329. break; \
  330. } \
  331. }
  332. /**
  333. * If `m_cond` evaluates to `true`, prints a custom error message and breaks from the loop the macro is located in.
  334. */
  335. #define ERR_BREAK_MSG(m_cond, m_msg) \
  336. { \
  337. if (unlikely(m_cond)) { \
  338. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Condition \"" _STR(m_cond) "\" is true. Breaking.", DEBUG_STR(m_msg)); \
  339. break; \
  340. } \
  341. }
  342. /**
  343. * Prints a generic error message and returns from the function.
  344. */
  345. #define ERR_FAIL() \
  346. { \
  347. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method failed."); \
  348. return; \
  349. }
  350. /**
  351. * Prints a custom error message and returns from the function.
  352. */
  353. #define ERR_FAIL_MSG(m_msg) \
  354. { \
  355. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method failed.", DEBUG_STR(m_msg)); \
  356. return; \
  357. }
  358. /**
  359. * Prints a generic error message and returns the value specified in `m_retval`.
  360. */
  361. #define ERR_FAIL_V(m_retval) \
  362. { \
  363. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method failed. Returning: " __STR(m_retval)); \
  364. return m_retval; \
  365. }
  366. /**
  367. * Prints a custom error message and returns the value specified in `m_retval`.
  368. */
  369. #define ERR_FAIL_V_MSG(m_retval, m_msg) \
  370. { \
  371. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "Method failed. Returning: " __STR(m_retval), DEBUG_STR(m_msg)); \
  372. return m_retval; \
  373. }
  374. /**
  375. * Crashes the engine immediately with a generic error message.
  376. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  377. */
  378. #define CRASH_NOW() \
  379. { \
  380. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Method failed."); \
  381. GENERATE_TRAP \
  382. }
  383. /**
  384. * Crashes the engine immediately with a custom error message.
  385. * Only use this if there's no sensible fallback (i.e. the error is unrecoverable).
  386. */
  387. #define CRASH_NOW_MSG(m_msg) \
  388. { \
  389. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "FATAL: Method failed.", DEBUG_STR(m_msg)); \
  390. GENERATE_TRAP \
  391. }
  392. /**
  393. * Prints an error message without returning.
  394. */
  395. #define ERR_PRINT(m_string) \
  396. { \
  397. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \
  398. }
  399. /**
  400. * Prints an error message without returning.
  401. * FIXME: Remove this macro and replace all uses with `ERR_PRINT` as it's identical.
  402. */
  403. #define ERR_PRINTS(m_string) \
  404. { \
  405. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \
  406. }
  407. /**
  408. * Prints an error message without returning, but only do so once in the application lifecycle.
  409. * This can be used to avoid spamming the console with error messages.
  410. */
  411. #define ERR_PRINT_ONCE(m_string) \
  412. { \
  413. static bool first_print = true; \
  414. if (first_print) { \
  415. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string); \
  416. first_print = false; \
  417. } \
  418. }
  419. /**
  420. * Prints a warning message without returning. To warn about deprecated usage,
  421. * use `WARN_DEPRECATED` or `WARN_DEPRECATED_MSG` instead.
  422. */
  423. #define WARN_PRINT(m_string) \
  424. { \
  425. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \
  426. }
  427. /**
  428. * Prints a warning message without returning.
  429. * FIXME: Remove this macro and replace all uses with `WARN_PRINT` as it's identical.
  430. */
  431. #define WARN_PRINTS(m_string) \
  432. { \
  433. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \
  434. }
  435. /**
  436. * Prints a warning message without returning, but only do so once in the application lifecycle.
  437. * This can be used to avoid spamming the console with warning messages.
  438. */
  439. #define WARN_PRINT_ONCE(m_string) \
  440. { \
  441. static bool first_print = true; \
  442. if (first_print) { \
  443. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, m_string, ERR_HANDLER_WARNING); \
  444. first_print = false; \
  445. } \
  446. }
  447. /**
  448. * Prints a generic deprecation warning message without returning.
  449. * This should be preferred to `WARN_PRINT` for deprecation warnings.
  450. */
  451. #define WARN_DEPRECATED \
  452. { \
  453. static volatile bool warning_shown = false; \
  454. if (!warning_shown) { \
  455. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future.", ERR_HANDLER_WARNING); \
  456. warning_shown = true; \
  457. } \
  458. }
  459. /**
  460. * Prints a custom deprecation warning message without returning.
  461. * This should be preferred to `WARN_PRINT` for deprecation warnings.
  462. */
  463. #define WARN_DEPRECATED_MSG(m_msg) \
  464. { \
  465. static volatile bool warning_shown = false; \
  466. if (!warning_shown) { \
  467. _err_print_error(FUNCTION_STR, __FILE__, __LINE__, "This method has been deprecated and will be removed in the future.", m_msg, ERR_HANDLER_WARNING); \
  468. warning_shown = true; \
  469. } \
  470. }
  471. #endif