PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/indra/llcommon/llerrorlegacy.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 118 lines | 53 code | 25 blank | 40 comment | 1 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
 28#ifndef LL_LLERRORLEGACY_H
 29#define LL_LLERRORLEGACY_H
 30
 31#include "llpreprocessor.h"
 32
 33/*
 34	LEGACY -- DO NOT USE THIS STUFF ANYMORE
 35*/
 36
 37// Specific error codes
 38const int LL_ERR_NOERR = 0;
 39const int LL_ERR_ASSET_REQUEST_FAILED = -1;
 40//const int LL_ERR_ASSET_REQUEST_INVALID = -2;
 41const int LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE = -3;
 42const int LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE = -4;
 43const int LL_ERR_INSUFFICIENT_PERMISSIONS = -5;
 44const int LL_ERR_EOF = -39;
 45const int LL_ERR_CANNOT_OPEN_FILE = -42;
 46const int LL_ERR_FILE_NOT_FOUND = -43;
 47const int LL_ERR_FILE_EMPTY     = -44;
 48const int LL_ERR_TCP_TIMEOUT    = -23016;
 49const int LL_ERR_CIRCUIT_GONE   = -23017;
 50const int LL_ERR_PRICE_MISMATCH = -23018;
 51
 52
 53
 54// Define one of these for different error levels in release...
 55// #define RELEASE_SHOW_DEBUG // Define this if you want your release builds to show lldebug output.
 56#define RELEASE_SHOW_INFO // Define this if you want your release builds to show llinfo output
 57#define RELEASE_SHOW_WARN // Define this if you want your release builds to show llwarn output.
 58
 59
 60//////////////////////////////////////////
 61//
 62//  Implementation - ignore
 63//
 64//
 65#ifdef _DEBUG
 66#define SHOW_DEBUG
 67#define SHOW_WARN
 68#define SHOW_INFO
 69#define SHOW_ASSERT
 70#else // _DEBUG
 71
 72#ifdef LL_RELEASE_WITH_DEBUG_INFO
 73#define SHOW_ASSERT
 74#endif // LL_RELEASE_WITH_DEBUG_INFO
 75
 76#ifdef RELEASE_SHOW_DEBUG
 77#define SHOW_DEBUG
 78#endif
 79
 80#ifdef RELEASE_SHOW_WARN
 81#define SHOW_WARN
 82#endif
 83
 84#ifdef RELEASE_SHOW_INFO
 85#define SHOW_INFO
 86#endif
 87
 88#ifdef RELEASE_SHOW_ASSERT
 89#define SHOW_ASSERT
 90#endif
 91
 92#endif // _DEBUG
 93
 94
 95
 96#define lldebugst(type)			lldebugs
 97#define llendflush				llendl
 98
 99
100#define llerror(msg, num)		llerrs << "Error # " << num << ": " << msg << llendl;
101
102#define llwarning(msg, num)		llwarns << "Warning # " << num << ": " << msg << llendl;
103
104#define llassert_always(func)	if (LL_UNLIKELY(!(func))) llerrs << "ASSERT (" << #func << ")" << llendl;
105
106#ifdef SHOW_ASSERT
107#define llassert(func)			llassert_always(func)
108#define llverify(func)			llassert_always(func)
109#else
110#define llassert(func)
111#define llverify(func)			do {if (func) {}} while(0)
112#endif
113
114// handy compile-time assert - enforce those template parameters! 
115#define cassert(expn) typedef char __C_ASSERT__[(expn)?1:-1]   /* Flawfinder: ignore */
116	//XXX: used in two places in llcommon/llskipmap.h
117
118#endif // LL_LLERRORLEGACY_H