/indra/llcommon/llerrorlegacy.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 118 lines · 53 code · 25 blank · 40 comment · 2 complexity · 92ab170883ae6f4d69fd66b76805b6fb MD5 · raw file

  1. /**
  2. * @file llerrorlegacy.h
  3. * @date January 2007
  4. * @brief old things from the older error system
  5. *
  6. * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  7. * Second Life Viewer Source Code
  8. * Copyright (C) 2010, Linden Research, Inc.
  9. *
  10. * This library is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation;
  13. * version 2.1 of the License only.
  14. *
  15. * This library is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with this library; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. *
  24. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  25. * $/LicenseInfo$
  26. */
  27. #ifndef LL_LLERRORLEGACY_H
  28. #define LL_LLERRORLEGACY_H
  29. #include "llpreprocessor.h"
  30. /*
  31. LEGACY -- DO NOT USE THIS STUFF ANYMORE
  32. */
  33. // Specific error codes
  34. const int LL_ERR_NOERR = 0;
  35. const int LL_ERR_ASSET_REQUEST_FAILED = -1;
  36. //const int LL_ERR_ASSET_REQUEST_INVALID = -2;
  37. const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3;
  38. const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4;
  39. const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5;
  40. const int LL_ERR_EOF = -39;
  41. const int LL_ERR_CANNOT_OPEN_FILE = -42;
  42. const int LL_ERR_FILE_NOT_FOUND = -43;
  43. const int LL_ERR_FILE_EMPTY = -44;
  44. const int LL_ERR_TCP_TIMEOUT = -23016;
  45. const int LL_ERR_CIRCUIT_GONE = -23017;
  46. const int LL_ERR_PRICE_MISMATCH = -23018;
  47. // Define one of these for different error levels in release...
  48. // #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
  49. #define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
  50. #define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
  51. //////////////////////////////////////////
  52. //
  53. // Implementation - ignore
  54. //
  55. //
  56. #ifdef _DEBUG
  57. #define SHOW_DEBUG
  58. #define SHOW_WARN
  59. #define SHOW_INFO
  60. #define SHOW_ASSERT
  61. #else // _DEBUG
  62. #ifdef LL_RELEASE_WITH_DEBUG_INFO
  63. #define SHOW_ASSERT
  64. #endif // LL_RELEASE_WITH_DEBUG_INFO
  65. #ifdef RELEASE_SHOW_DEBUG
  66. #define SHOW_DEBUG
  67. #endif
  68. #ifdef RELEASE_SHOW_WARN
  69. #define SHOW_WARN
  70. #endif
  71. #ifdef RELEASE_SHOW_INFO
  72. #define SHOW_INFO
  73. #endif
  74. #ifdef RELEASE_SHOW_ASSERT
  75. #define SHOW_ASSERT
  76. #endif
  77. #endif // _DEBUG
  78. #define lldebugst(type) lldebugs
  79. #define llendflush llendl
  80. #define llerror(msg, num) llerrs << "Error # " << num << ": " << msg << llendl;
  81. #define llwarning(msg, num) llwarns << "Warning # " << num << ": " << msg << llendl;
  82. #define llassert_always(func) if (LL_UNLIKELY(!(func))) llerrs << "ASSERT (" << #func << ")" << llendl;
  83. #ifdef SHOW_ASSERT
  84. #define llassert(func) llassert_always(func)
  85. #define llverify(func) llassert_always(func)
  86. #else
  87. #define llassert(func)
  88. #define llverify(func) do {if (func) {}} while(0)
  89. #endif
  90. // handy compile-time assert - enforce those template parameters!
  91. #define cassert(expn) typedef char __C_ASSERT__[(expn)?1:-1] /* Flawfinder: ignore */
  92. //XXX: used in two places in llcommon/llskipmap.h
  93. #endif // LL_LLERRORLEGACY_H